Note: Latest release and documentation are available from extension github page.
This extension allows you to use Twig templates in Yii.
Resources ¶
Documentation ¶
Twig view renderer ¶
This extension allows you to use Twig templates in Yii.
Resources ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions
. - Download and extract all Twig files from
fabpot-Twig-______.zip\fabpot-Twig-______\lib\Twig\
underprotected/vendors/Twig
. - Add the following to your config file 'components' section:
'viewRenderer'=>array(
'class'=>'ext.yiiext.renderers.twig.ETwigViewRenderer',
'fileExtension' => '.html',
'options' => array(
'autoescape' => true,
),
'extentions' => array(
'My_Twig_Extension',
),
),
Usage ¶
- See Twig syntax.
- Current controller properties are accessible via {{this.pageTitle}}.
Change Log ¶
0.9.4 ¶
- Added an ability to set Twig environment options (Sam Dark)
- Added an ability to load extensions (Roman, Sam Dark)
0.9.3 ¶
- Fixed renderFile method (AlexandrZ, Sam Dark)
- Extension is now theme-aware (zadoev, Sam Dark)
0.9.2 ¶
- Changed translation category to 'yiiext'.
- New naming conventions.
0.9.1 ¶
- Changes for new version Twig http://blog.twig-project.org/post/266735026/twig-0-9-4-released
0.9 ¶
- Initial public release (Sam Dark)
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.