diatechnis / twig-single-file-components
Create Vue-like single components with Twig
dev-master
2018-11-17 15:28 UTC
Requires
- roave/security-advisories: dev-master
- twig/twig: ^2.0.0
Requires (Dev)
- phpunit/phpunit: ^7.2
This package is auto-updated.
Last update: 2025-03-06 10:59:39 UTC
README
Create Vue-like single components with Twig
Quickstart
$twig = new \TwigSingleFileComponents\Environment($twig_loader); $rendered = $twig->render($template, $data);
This will create an extended version of the Twig environment. On instantiation, the environment will create script, style and template parsers.
On render, the parsers will look for the proper tags ({% script %}
, {% style %}
, {% template %}
), and store the contents of those tags.