Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable Twig's dump() in Symfony2

Tags:

yaml

twig

symfony

Seeing various threads on this topic but not finding a working answer. Have a simple Symfony2 app (2.3.5) and trying to dump variables passed into my Twig templates. I have in my app/config/config.yml:

# Twig Configuration
twig:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%

and in my app/config/config_dev.yml:

services:
    twig.extension.debug:
        class: Twig_Extensions_Extension_Debug
        tags:
           - { name: twig.extension }

But using dump() in a twig still renders an empty page. I also increased memory limit in php.ini to 512 ... still nothing

Which part of this am I missing?

like image 290
shotdsherrif Avatar asked Feb 15 '23 09:02

shotdsherrif


1 Answers

Try class: Twig_Extension_Debug instead. :)

like image 53
Martin Lie Avatar answered Feb 16 '23 21:02

Martin Lie