Skip to content

Use {{ dump() }} and {% dump() %} in Twig templates #17731

Closed
@steevanb

Description

@steevanb

Hi,

According to the documentation: https://symfony.com/doc/current/templates.html#the-dump-twig-utilities, we have to execute composer require --dev symfony/var-dumper to have {{ dump() }} and {% dump() %} in Twig templates.

But with only this command, we have access to only {{ dump() }} (original Twig function, just a var_dump() and do not use the var-dumper dump() function) and not {% dump() %} (error : Unexpected "dump" tag (expecting closing tag for the "block" tag defined near line 17).)

So, to make it works, we need to have symfony/debug-bundle installed too.

I'm not sure it's a documentation issue, or if we should have var-dumper used by Twig only with the installation of symfony/var-dumper, as written in the documentation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions