fenghuilee / yii2-smartyviewer
The Smarty Viewer integration for the Yii framework 2+
Installs: 84
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/fenghuilee/yii2-smartyviewer
Requires
This package is not auto-updated.
Last update: 2025-10-25 23:20:16 UTC
README
This extension provides a ViewRender that would allow you to use Smarty view template engine.
To use this extension, simply add the following code in your application configuration and web controller:
xxx/config/main.php
return [
//....
'components' => [
'smarty' => [
'class' => 'yii\smartyviewer\SmartyViewer',
//'themeName' => 'basic',
//'cachePath' => '@runtime/Smarty/cache',
//'options' => [
// 'left_delimiter' => '<{',
// 'right_delimiter' => '}>',
//],
],
],
];
XxxxController.php
public function init()
{
Yii::$app->smarty->init();
parent::init();
//other code
}
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist fenghuilee/yii2-smartyviewer "*"
or add
"fenghuilee/yii2-smartyviewer": "*"
to the require section of your composer.json.
Note that the smarty composer package is distributed using subversion so you may need to install subversion.