rrcom/rrcom-less-module

用于Zend Framework 2的CSS LESS编译模块

v1.1.0 2015-01-20 10:24 UTC

This package is not auto-updated.

Last update: 2024-09-24 04:04:49 UTC


README

自动将LESS文件编译成CSS的Zend框架2模块

如何使用

  1. 将此模块保存到您的模块目录中
  2. 在zf2配置中的模块数组(config/application.config.php)中添加"RrcomLessModule"
  3. 在config/autoload目录中创建"rrcomlessmodule.local.php"
  4. 用以下示例值填充"rrcomlessmodule.local.php"
<?php
return array(
    'rrcomlessmodule' => array(
        // enable or disable auto compiling (must be disable in production environment to reduce processing time)
        'enable' => true,
        
        // The files to compile and theirs output directory
        'files' => array(
            array(
                // .less source directory 1
                'less-file' => './public/less/sample1.less',
                
                // .css output directory 1
                'css-file' => './public/css/sample1.css',
                
                /*
                * Set formatter
                * lessjs (default) — Same style used in LESS for JavaScript
                * compressed — Compresses all the unrequired whitespace
                * classic — lessphp’s original formatter
                */
                'formatter' => 'compressed',
            ),
            
            // If you need to compile multiple less files just add another array
            array(
                // .less source directory 2
                'less-file' => './public/less/sample2.less',
                
                // .css output directory 2
                'css-file' => './public/css/sample2.css',
                
                // Set formatter
                'formatter' => 'compressed',
            ),
        ),
    ),
);