library twig-renderable-extension
dtkahl/twig-renderable-extension
- Friday, August 18, 2017
- by dtkahl
- Repository
- 1 Watchers
- 0 Stars
- 13 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Twig Renderable Extension
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()
., (*1)
{% render instance %}
Dependencies
PHP >=7.0.0
twig\twig ^2.0
Installation
Install with Composer:, (*2)
composer require dtkahl/twig-renderable-extension
Register the extension to the Twig instance:, (*3)
use \Dtkahl\FormBuilder|TwigRenderableExtension;
$twig->addExtension(new TwigRenderableExtension);