Skip to content

diatechnis/twig-single-file-components

Repository files navigation

Twig Single File Components

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.

About

Create Vue-like single components with Twig

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published