I want to set following Headers for TWIG Template from within my DefaultController:
header(\'Access-Control-Allow-Methods: GET, POST, OPTIONS\');
header(\'Ac
If you are using the render() method of the controller, then you can add the necessary headers like below because render() method returns a Response object:
$response = $this->render('AppBundle:Post:index.html.twig', array('someArgs' => $someArgs));
$response->headers->set('Content-Type', 'text/html');
return $response;