How to enable twig dump () in symfony2

Browse various topics on this topic, but not search for a working answer. Try the simple Symfony2 application (2.3.5) and try to reset the variables passed to my Twig templates. In my application /config/config.yml:

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

and in my application / config / config _dev.yml:

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

But using dump () in the branch still displays a blank page. I also increased the memory limit in php.ini to 512 ... nothing else

What part of this am I missing?

+4
source share
5 answers

Try it class: Twig_Extension_Debug. :)

+6
source

symfony2.3 , twig.debug true, .

+1

, :

# app/config.yml
twig:
    debug: %kernel.debug%

Twig:

{% dump var %}

Symfony 2.7

0

define ('WP_DEBUG', true); wp-config.php - Twig.

-3

All Articles