twig-view-renderer

Allows you to use Twig templates in Yii
9 followers

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\ under protected/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)

Be the first person to leave a comment

Please to leave your comment.

Create extension