Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] Error when rendering static templates #52655

Closed
@javiereguiluz

Description

@javiereguiluz

Symfony version(s) affected

7.0

Description

When updating Symfony Demo to 7.0, I'm seeing this error:

An exception has been thrown during the rendering of a template:
"Callable "Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction()"
is not allowed as a controller.

Did you miss tagging it with "#[AsController]" or registering its type with 
"Symfony\Component\HttpKernel\Controller\ControllerResolver::allowControllers()"?"

This error doesn't happen in 6.4.

How to reproduce

Just run the Symfony Demo with 7.0. Whenever Symfony finds a TemplateController::templateAction it will show the error. For example:

https://github.com/symfony/demo/blob/206f0c9aab07cdc9f7437640b12947d35e9d5e72/templates/base.html.twig#L138-L142

https://github.com/symfony/demo/blob/206f0c9aab07cdc9f7437640b12947d35e9d5e72/config/routes.yaml#L5-L12

Possible Solution

I don't know. But this only happens in Symfony 7.0, not 6.4.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions