Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony web debug tool bar

Tags:

php

symfony

When I visit http://localhost/web/app_dev.php I get a very nice web debug toolbar but It doesn't appear in the views rendered by "custom" controllers.

What to do so the debug toolbar to be visible in the views rendered by controllers ?

Here is an example of the controller I use

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));
    }
}
like image 660
objc_bd Avatar asked Oct 02 '13 21:10

objc_bd


1 Answers

The toolbar inserts itself in pages by looking for a terminating </body> tag on your generated page.

If you don't have a </body> tag in your page the toolbar will not appear.

You also need to make sure you're using the dev mode by accessing the page via app_dev.php, e.g.

http://example.com/app_dev.php/hello/world

like image 146
Tegran Avatar answered Sep 17 '22 15:09

Tegran