当我访问http://localhost/web/app_dev.php
时,我得到了一个非常漂亮的Web调试工具栏,但它不会出现在“自定义” Controller 呈现的 View 中。
如何才能使调试工具栏在 Controller 呈现的 View 中可见?
这是我使用的 Controller 的示例
namespace SD\BlogBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ContactsController extends Controller
{
public function indexAction()
{
$data = 'Lorem ipsum';
return $this->render('SDBlogBundle:Default:index.html.twig', array('data' => $data));
}
}
最佳答案
工具栏通过在生成的页面上查找终止