03/06
2016
Wallogit.com
2017 © Pedro Peláez
Brings Twig template engine support for Fwk\Core Applications., (*1)
Via Composer:, (*2)
{
"require": {
"nitronet/fwk-twig": "dev-master",
}
}
If you don't use Composer, you can still download this repository and add it
to your include_path PSR-0 compatible, (*3)
Define a Twig_Environment instance in your Di Container, and configure it the way you want:, (*4)
``` xml
### 3: Register Twig ResultType Registers a new ResultType in fwk.xml: ``` xml <result-type name="twig" class="FwkTwig\TwigResultType"> <param name="twigService">twig</param> </result-type>
Use the ResultType where you want:, (*8)
xml
<action name="Home" shortcut="MyApp\Controllers\Home:show">
<result name="success" type="twig">
<param name="file">home.twig</param>
</result>
</action>, (*9)