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));
}
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With