'error', 'key' => 'jsx', 'method' => 'download', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_LIST', $token); $file = base64_encode(file_get_contents($params->get('kernel.project_dir') . '/' . $params->get('arborescence_generation_jsx') . '/global.jsx' )); if (empty($file)) { $body['data'] = "No File name 'globle.jsx' "; $respond->statusUnprocessableEntity(); } else { $body['type'] = 'success'; $body['data'] = $file; $respond->statusOk(); } return $respond->createBody($body)->respond(); } }