fenghuilee/yii2-smartyviewer

The Smarty Viewer integration for the Yii framework 2+

1.0.3 2015-05-14 09:21 UTC

This package is not auto-updated.

Last update: 2024-12-21 19:11:56 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.