Download the PHP package smcgarrity/rhubarb-module-leaf-twigview without Composer
On this page you can find all versions of the php package smcgarrity/rhubarb-module-leaf-twigview. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smcgarrity/rhubarb-module-leaf-twigview
More information about smcgarrity/rhubarb-module-leaf-twigview
Files in smcgarrity/rhubarb-module-leaf-twigview
Package rhubarb-module-leaf-twigview
Short Description Twig integrated View for Rhubarb
License Apache-2.0
Homepage https://github.com/smcgarrity/Module.Leaf.TwigView
Informations about the package rhubarb-module-leaf-twigview
Module.Leaf.TwigView
Integration of Twig HTML template engine in a Rhubarb View.
Creating a Twig View
To create a twig view simply create a View that extends the TwigView class.
You will be have to implement two methods:
getTwigFileLocation() should return the location of your .twig or .html file as a string.
getTwigVariables() returns an array of values you want to be available in your Twig Template.
You will also need an actual Twig File to be compiled. Twig can compile any HTML file, but has additional support for twig features such as controls and variables. To format twig inputs use the PHPStorm .twig file.
TwigView uses the printViewContent method to render the HTML so if you extend printViewContent ensure to include a parent call.
Using Twig
Twig uses brackets { }
to insert variables and controls into a HTML template.
A variable can be output directly using double brackets.
Objects can be access with dot notation in the same way:
Controls can be added using {% %}
.
Full Twig Documentation: https://twig.symfony.com/doc/2.x/
All versions of rhubarb-module-leaf-twigview with dependencies
rhubarbphp/module-leaf Version ^1.0.0
twig/twig Version ^2.0