Yii2 Bootstrap 3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Suralc 4f97fced0f Added readme and license files to extensions. 11 years ago
..
yii/twig Added "@runtime" and "@vendor" aliases. 11 years ago
LICENSE.md Added readme and license files to extensions. 11 years ago
README.md Added readme and license files to extensions. 11 years ago
composer.json Reorganized Twig and Smarty dependencies 11 years ago

README.md

Yii 2.0 Public Preview - Twig View Renderer

Thank you for choosing Yii - a high-performance component-based PHP framework.

If you are looking for a production-ready PHP framework, please use Yii v1.1.

Yii 2.0 is still under heavy development. We may make significant changes without prior notices. Yii 2.0 is not ready for production use yet.

Build Status

This is the yii2-twig extension.

Installation

The prefered way to install this extension is through composer.

Either run

php composer.phar require yiisoft/yii2-twig *

or add

"yiisoft/yii2-twig": "*"

to the require section of your composer.json.

Note: You might have to run php composer.phar selfupdate

Usage & Documentation

This extension has to be registered prior to usage. To do this add the following to the $rendereres property of the view instance you want to use this with:

Example:

<?php
// config.php
return array(
	//....
	'components' => array(
		'view' => array(
			'class' => 'yii\base\View',
			'viewRenderers' => array(
				'twig' => array(
					'class' => 'yii\twig\ViewRenderer',
					//'cachePath' => '@runtime/Twig/cache',
					//'options' => array(), /*  Array of twig options */
				),
			),
		),
	),
);

For further instructions refer to the related section in the guide.