dtkahl / twig-renderable-extension
Package info
github.com/dtkahl/twig-renderable-extension
pkg:composer/dtkahl/twig-renderable-extension
1.0.0
2017-08-18 11:51 UTC
Requires
- php: >=7.0.0
- twig/twig: ^2.0
This package is auto-updated.
Last update: 2026-03-01 00:23:52 UTC
README
This package adds a custom render-tag to Twig. This tag automatically renders an instance of a class that implements the interface TwigRenderableInterface.
This is done by including the twig-template which is returned from $instance->getTemplate() with the data which got returned from $instance->getRenderData().
{% render instance %}
Dependencies
PHP >=7.0.0twig\twig ^2.0
Installation
Install with Composer:
composer require dtkahl/twig-renderable-extension
Register the extension to the Twig instance:
use \Dtkahl\FormBuilder|TwigRenderableExtension; $twig->addExtension(new TwigRenderableExtension);