fredjuvaux/silex-less-provider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fredjuvaux/silex-less-provider

Composer 安装命令:

composer require fredjuvaux/silex-less-provider

包简介

Simple less php service provider for Silex

README 文档

README

Simple less php service provider for Silex that uses https://github.com/leafo/lessphp as parser.

You'll find the following topics in this README:

Dependencies

Installation

You basically have three options to add this extension to your Silex project. We'd strongly recommend the first option!

composer.json

http://packagist.org/packages/fredjuvaux/silex-less-provider

php composer.phar require fredjuvaux/silex-less-provider dev-master

Or add to the dependencies in your projects composer.json file and update your dependencies::

"fredjuvaux/silex-less-provider": "dev-master"
php composer.phar update

This is by far the easiest way, since it automatically adds the Doctrine dependencies and adds everything to the autoloading mechanism supplied by Composer.

More information on Composer can be found on getcomposer.org.

Git

Another option is to clone the project:

cd /path/to/your_project/vendor
git clone git@github.com:fredjuvaux/silex-less-provider.git

Or you can add it as a submodule if your project is in a git repository too:

cd /path/to/your_project
git submodule add git@github.com:fredjuvaux/silex-less-provider.git

This will require you to manually install all the dependencies. Also note that you'll need to add the provider to the Silex autoloader (or whatever autoloading mechanism) by hand. More on both subjects can be found below.

Download an archive

GitHub also gives you the option to download an ZIP-archive, which you can extract in your vendor folder. This method will also require you to manually install all the dependencies and add everything to your autoloader.

Configuration

Registering the Less Service Provider is rather straight forward:

<?php

/* ... */

use Less\Provider\LessServiceProvider;

$app->register(new LessServiceProvider(), array(
    'less.source_dir'   => array(__DIR__.'/../web/less/'), // specify one or serveral directories for sources
    'less.cache_dir'    => __DIR__.'/../var/cache/', // specify one directory for caching files
    'less.target_dir'   => __DIR__.'/../web/css/', // specify one directory for compiled files
));

Use

The Less files have to be in sources directories. The files are cached and regenerated if it's needed.
In the Twig view, you have to call the css generated files (in less.target_dir).

统计信息

  • 总下载量: 627
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-27