'error', 'key' => 'twig', 'method' => 'getTwigView', 'data' => '', ]; $token = $request->headers->get('x-auth-token'); $security->isGranted('MAESTRO_PROJECT_TEMPLATE_READ', $token); $view = new CommonIdView( $id ); $twig = $query->getTwigView($view); if ($twig) { $body['type'] = 'success'; $body['data'] = $twig; $respond->statusOk(); } else { $body['data'] = "No Twig found for id : $view->id !"; $respond->statusUnprocessableEntity(); } return $respond->createBody($body)->respond(); } }