Max*_*nck 2 php header symfony
Symfony 2正在显示缓存标题,我想知道如何隐藏它们
例子
HTTP/1.0 200 OK Cache-Control: no-cache Content-Type: text/html Date: Fri, 18 Jan 2013 19:07:08 GMT HTTP/1.0 200 OK Cache-Control: no-cache Date: Fri, 18 Jan 2013 19:07:08 GMT X-Debug-Token: 50f99d5cba4da
Run Code Online (Sandbox Code Playgroud)
我在我的代码中使用它
return new Response($this->renderView('Shout/view/default.html.twig'));
Run Code Online (Sandbox Code Playgroud)
被调用的
$httpKernel = $this->container->get('http_kernel');
$response = new Response;
$response->SetContent($httpKernel->forward('MyBundle:Module/'.$module.'/'.$module.':index'));
$response->headers->set('Content-Type', 'text/html');
return $response;
Run Code Online (Sandbox Code Playgroud)
在树枝延伸
添加 - > getContent()结束.
http://api.symfony.com/2.0/Symfony/Component/HttpFoundation/Response.html
$response = $this->forward("MyBundle:Module:$module", array(
'customer_id' => $customer_id
))->getContent();
return $response;
Run Code Online (Sandbox Code Playgroud)