Skip to content

Issue with render_hinclude() when PHP templating engine is enabled #28001

Closed
@javiereguiluz

Description

@javiereguiluz

Symfony version(s) affected: all

Description
If you put the following in a Twig template:

{{ render_hinclude(controller('...'), {'default': 'Loading...'}) }}

The Loading... text is used as a fallback content (as explained in https://symfony.com/doc/3.4/templating/hinclude.html). However, if you enable the PHP engine in the app:

framework.templating.engines: ['twig', 'php']

Then, the Twig template no longer works and instead you see this error:

An exception has been thrown during the rendering of a template
("Template name "Loading..." contains invalid characters.").

Additional context
Originally reported by @liviubalan as a doc issue: symfony/symfony-docs#9790

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions