Skip to content

[TwigBundle] Document twig.safe_class resource tag#22319

Open
lacatoire wants to merge 2 commits intosymfony:8.1from
lacatoire:twigbundle-safe-class-tag-22307
Open

[TwigBundle] Document twig.safe_class resource tag#22319
lacatoire wants to merge 2 commits intosymfony:8.1from
lacatoire:twigbundle-safe-class-tag-22307

Conversation

@lacatoire
Copy link
Copy Markdown
Contributor

Documents the new 8.1 twig.safe_class resource tag from symfony/symfony#63929: bundles can now mark a class as safe for Twig's escaper (per strategy: html, js, css, etc.) without decorating the environment configurator. Adds the entry to reference/dic_tags.rst, an anchor on the existing "Tagging Non-Service Classes" section in service_container/tags.rst, and a cross-reference tip in the templates.rst output-escaping section.

Fixes #22307

@carsonbot carsonbot added this to the 8.1 milestone May 4, 2026
@lacatoire lacatoire force-pushed the twigbundle-safe-class-tag-22307 branch from 1b1fe97 to bb70f6c Compare May 4, 2026 09:24
@GromNaN
Copy link
Copy Markdown
Member

GromNaN commented May 7, 2026

Thanks for this contribution! 🙏

Unfortunately, this feature isn't available yet: it depends on twigphp/Twig#4795, which is still pending. This PR should be put on hold until the Twig PR is merged. Once it is, the documentation will also need to specify the minimum required Twig version.

Comment thread reference/dic_tags.rst
Comment thread reference/dic_tags.rst Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants