Skip to content

Use the current template reference in the configuration example - #507

Open
Amoifr wants to merge 1 commit into
KnpLabs:masterfrom
Amoifr:fix-504-menu-template-reference
Open

Use the current template reference in the configuration example#507
Amoifr wants to merge 1 commit into
KnpLabs:masterfrom
Amoifr:fix-504-menu-template-reference

Conversation

@Amoifr

@Amoifr Amoifr commented Aug 31, 2026

Copy link
Copy Markdown

Closes #504.

The section says the block lists the default configuration, but the template it shows is neither the default nor resolvable.

Configuration.php already defaults to @KnpMenu/menu.html.twig, and KnpMenuExtensionTest asserts it:

->scalarNode('template')->defaultValue('@KnpMenu/menu.html.twig')->end()

The documented KnpMenuBundle::menu.html.twig is wrong twice over. The Bundle::template syntax was deprecated in Symfony 4.4 and removed in 5.0, so this has been broken for longer than the report suggests, and even under the old syntax it resolved to Resources/views/, while the template has since moved to templates/menu.html.twig.

@vpassama reported the YAML block. The same value appears in the XML and PHP blocks of the same configuration-block, so all three are updated. The YAML one needs quotes, since an unquoted @ starts a reserved indicator and the file would no longer parse.

I left the rest of the section alone, including the loadFromExtension() style of the PHP block, to keep this to the reported problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation about configuration with Symfony 8

2 participants