Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Twig][TwigBundle] Document twig.safe_class resource tag#22319

Merged
javiereguiluz merged 1 commit into
symfony:8.1symfony/symfony-docs:8.1from
lacatoire:twigbundle-safe-class-tag-22307lacatoire/symfony-docs:twigbundle-safe-class-tag-22307Copy head branch name to clipboard
May 19, 2026
Merged

[Twig][TwigBundle] Document twig.safe_class resource tag#22319
javiereguiluz merged 1 commit into
symfony:8.1symfony/symfony-docs:8.1from
lacatoire:twigbundle-safe-class-tag-22307lacatoire/symfony-docs:twigbundle-safe-class-tag-22307Copy head branch name to clipboard

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
@lacatoire lacatoire force-pushed the twigbundle-safe-class-tag-22307 branch from d8b3b16 to 0fd79cc Compare May 12, 2026 07:58
@GromNaN
Copy link
Copy Markdown
Member

GromNaN commented May 17, 2026

This PR is unlocked. The required twig version is 3.25.0

@carsonbot carsonbot changed the title [TwigBundle] Document twig.safe_class resource tag [Twig][TwigBundle] Document twig.safe_class resource tag May 19, 2026
@javiereguiluz javiereguiluz force-pushed the twigbundle-safe-class-tag-22307 branch from 0fd79cc to 1718639 Compare May 19, 2026 07:03
@javiereguiluz javiereguiluz merged commit c5af0ea into symfony:8.1 May 19, 2026
2 of 3 checks passed
@javiereguiluz
Copy link
Copy Markdown
Member

Merged! Thanks Louis-Arnaud.

Jérôme, we added the "Teig 3.25" requirement while merging. Thanks.

@GromNaN
Copy link
Copy Markdown
Member

GromNaN commented May 19, 2026

@javiereguiluz Twig 3.25 is now required by Symfony 8.1, so we don't need to document it. symfony/symfony#64242

@lacatoire lacatoire deleted the twigbundle-safe-class-tag-22307 branch May 19, 2026 07:49
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.