dev-master
9999999-devThe LightnCandy integration for the Yii2 framework.
MIT
The Requires
template php yii2 renderer handlebars mustache logicless lightncandy
The LightnCandy integration for the Yii2 framework.
Yii2 lightncandy extention/, (*1)
This extension provides a ViewRender
that would allow you to use LightnCandy, an extremely fast PHP implementation of handlebars and mustache., (*2)
To use this extension, simply add the following code in your application configuration:, (*3)
return [ //.... 'components' => [ 'view' => [ 'renderers' => [ 'handlebars' => [ 'class' => 'kfreiman\lightncandy\ViewRenderer', // the file extension of Handlebars templates // 'extension' => ['.handlebars', '.mustache']', // path alias pointing to where Handlebars cache will be stored. Set to false to disable templates cache. // 'cache_preffix' => 'LightnCandy_', // 'flags' => LightnCandy::FLAG_INSTANCE | // LightnCandy::FLAG_NOESCAPE | // LightnCandy::FLAG_SPVARS | // LightnCandy::FLAG_RUNTIMEPARTIAL | // LightnCandy::FLAG_HANDLEBARSJS // // and at Yii dev enviroment // LightnCandy::FLAG_ERROR_EXCEPTION | // LightnCandy::FLAG_RENDER_DEBUG // additional LightnCandy options // 'options' => []', ], ], ], ], ];
Or, you can declarate view component in your code, (*4)
Yii::$app->set('view', [ 'class' => 'yii\web\View', 'renderers' => [ 'handlebars' => [ 'class' => 'kfreiman\lightncandy\ViewRenderer', 'extension' => ['.handlebars','.js','.mustache'], ], ] ]);
The preferred way to install this extension is through composer., (*5)
Either run, (*6)
php composer.phar require --prefer-dist kfreiman/yii2-lightncandy
or add, (*7)
"kfreiman/yii2-lightncandy": "*"
to the require section of your composer.json., (*8)
The LightnCandy integration for the Yii2 framework.
MIT
template php yii2 renderer handlebars mustache logicless lightncandy