2017 © Pedro Peláez
 

yii2-extension yii2-lightncandy

The LightnCandy integration for the Yii2 framework.

image

kfreiman/yii2-lightncandy

The LightnCandy integration for the Yii2 framework.

  • Tuesday, April 7, 2015
  • by k.freiman
  • Repository
  • 1 Watchers
  • 1 Stars
  • 66 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-lightncandy

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'],
        ],
    ]
]);

Installation

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 Versions

07/04 2015

dev-master

9999999-dev

The LightnCandy integration for the Yii2 framework.

  Sources   Download

MIT

The Requires

 

template php yii2 renderer handlebars mustache logicless lightncandy