我希望始终以开发模式显示工具栏,而不仅仅是错误。 我有以下方法: p>
/ **
* @Route(“/”,name =“homepage”)
* /
npublic function indexAction(Request $ 请求):JsonResponse
{
返回新的JsonResponse($ param);
}
code> pre>
我运行以测试工具栏。 这会产生错误,因为 $ param code>会出现工具栏。 但是,当我使用返回新的JsonResponse('aaa'); code>时,一切正常,工具栏也不会出现。 p>
如何使工具栏显示即使没有错误? p>
config: p>
framework:
templating:
engines:['twig']
router:
resource: “%kernel.root_dir%/ config / dev / routing.yml”
strict_requirements:true
profiler:{only_exceptions:false}
web_profiler:
toolbar:true
intercept_redirects:true
code> pre>
AppKernel: p>
if(in_array($ this-> getEnvironment(),array('dev','test') ,true)){
$ bundles [] =新的Symfony \ Bundle \ TwigBundle \ TwigBundle();
}
code> pre>
div>