README.md 761 Bytes
Newer Older
1 2
Smarty Extension for Yii 2
==========================
3

4
This extension provides a `ViewRender` that would allow you to use Smarty view template engine.
5

6
To use this extension, simply add the following code in your application configuration:
7

8
```php
Alexander Makarov committed
9
return [
10
	//....
Alexander Makarov committed
11 12 13 14
	'components' => [
		'view' => [
			'renderers' => [
				'tpl' => [
15 16
					'class' => 'yii\smarty\ViewRenderer',
					//'cachePath' => '@runtime/Smarty/cache',
Alexander Makarov committed
17 18 19 20 21
				],
			],
		],
	],
];
22 23
```

24 25 26 27 28 29 30 31
Installation
------------

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
32
php composer.phar require --prefer-dist yiisoft/yii2-smarty "*"
33 34 35 36 37 38 39 40 41
```

or add

```json
"yiisoft/yii2-smarty": "*"
```

to the require section of your composer.json.