Skip to content
A cclientscript extension for YII to parse Less files
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LessClientscript corrects file extension code to use pathinfo. fixes #2
README.md Fix typo on installation

README.md

Installation

Copy this repo to your Yii application extension folder (default protected/extensions)

Usage

Add the extension to your configuration

    ...
    'components' => array(
        ...
        'clientScript' => array(
            'class' => 'ext.LessClientscript.LClientscript',
            'caching' => true,
            'compress' => false,
            'importDir' => array('themes/classic/less/')
        )
        ...
    )
    ...

To call it into your view

    // SiteController.php file
    public function actionIndex()
    {
        Yii::app()->clientScript->registerCSSFile('/assets/css/test.less','screen');
          $this->render('index');
    }

Attributes

caching: Boolean true or false, default true Use a cached version of the compiled less if available.

compress: Boolean, default false Removes whitespace and linearizes the css to 1 line.

Credits

Based on LessCSS for Yii by zsoltlengyelit Lessc parser by Leaf Corcoran

Something went wrong with that request. Please try again.