Download the PHP package webfactory/html5-tagrewriter-bundle without Composer
On this page you can find all versions of the php package webfactory/html5-tagrewriter-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webfactory/html5-tagrewriter-bundle
More information about webfactory/html5-tagrewriter-bundle
Files in webfactory/html5-tagrewriter-bundle
Package html5-tagrewriter-bundle
Short Description Symfony bundle for webfactory/html5-tagrewriter integration
License MIT
Homepage https://github.com/webfactory/WebfactoryHtml5TagRewriterBundle
Informations about the package html5-tagrewriter-bundle
WebfactoryHtml5TagRewriterBundle
This bundle provides Symfony integration for the webfactory/html5-tagrewriter package.
Core feature is the Twig filter rewriteTags, which allows sections of HTML5 in Twig templates to be processed by RewriteHandlers. RewriteHandlers can be configured in the container through tags or using an autoconfiguration attribute.
See the webfactory/html5-tagrewriter documentation for details on what a RewriteHandler is and how to implement one. Processing is based on the PHP 8.4 DOM HTML5 parser (Dom\HTMLDocument).
Usage in Twig
Use the rewriteTags filter to process HTML through a TagRewriter:
Registering RewriteHandlers
Using the #[AsRewriteHandler] Attribute (Recommended)
The easiest way to register a RewriteHandler is using the #[AsRewriteHandler] attribute. With autowiring and autoconfiguration enabled, the handler will be automatically registered:
Attribute Options
The #[AsRewriteHandler] attribute accepts two optional parameters:
priority(int, default:0): Higher values are processed firstrewriter(string or array, default:'default'): The name(s) of the TagRewriter instance(s) to register with
Using Service Tags
If you need more control or cannot use autoconfiguration, you can manually tag your services with webfactory.html5_tag_rewriter.rewrite_handler:
Credits, Copyright and License
This bundle is based on internal work that we have been using at webfactory GmbH, Bonn, since 2019. However, that (old) bundle implementation was written for the legacy PHP DOM extension, leading to several quirks in HTML processing and requiring the use of Polyglot HTML 5.
Thus, we decided to overhaul the bundle for PHP 8.4 HTML5 DOM support and re-release it as open source.
Copyright 2026 webfactory GmbH, Bonn. Code released under the MIT license.
All versions of html5-tagrewriter-bundle with dependencies
symfony/config Version ^6.4 || ^7.4 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.4 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.4 || ^8.0
twig/twig Version ^3.0
webfactory/html5-tagrewriter Version ^1.0