The dump of a fork prints nothing

I'm a little confused now. I've always used the branch dump function like any other twig function, but now it has absolutely no output. No errors / exceptions, just nothing. Everything else works fine as a trans filter.

{{ dump('test') }} # prints nothing
{{ 'layout.booking.chooseArea'|trans }} # prints the translated message

      

Now this template does not contain anything else. The dump also doesn't work in the parent template or in the base.html.twig file.

Again the dump prints nothing: not an empty line, not zero, not one pixel on the screen.

Any ideas what might be causing this?

Symfony version: 2.6.x-dev

Update

{{ dump('test') }} # doesn't work (anymore?)
{% dump('test') %} # does (still) work

      

Was it successful? Why are there no mistakes? By the way ... the debug flag is set.

+3


source to share


1 answer


Symfony 2.6 introduces a new component VarDumper and DebugBundle. These override twig functions dump()

produce a lot more and nicer output.

However, you need to register the DebugBundle with AppKernel

, otherwise it will simply ignore the call. To do this, you must add this to app/AppKernel.php

:

// app/AppKernel.php

// ...
public function registerBundles()
{
    // ...

    if (in_array($this->getEnvironment(), array('dev', 'test'))) {
        $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
        // ...
    }

    return $bundles;
}

      



Note that this new dump feature will dump the output to the web developer toolbar to avoid page layout overlap.

In version 2.6.0 this will be fixed by reverting to the built-in twig function dump()

, why DebugBundle is not registered.

+5


source







All Articles