rafie / cssminifier
关于此包最新版本(v1.0)的许可信息不可用。
Laravel 的简单 CSS 最小化器
v1.0
2014-05-03 11:09 UTC
Requires
- php: >=5.4.0
- illuminate/support: 4.1.*
This package is auto-updated.
Last update: 2024-08-29 03:58:00 UTC
README
简单 CSS 最小化器,基于 GarryJones css minifer。
##安装
在你的 composer.json
文件中,需要 rafie/Cssminifier
并运行 composer dumpautoload
。
下载完成后,在你的 app/config/app.php
中,你需要
- 将
Rafie\Cssminifier\CssminifierServiceProvider
添加到providers
数组中。 - 将
'CssMin' => 'Rafie\Cssminifier\Facades\CssMin'
添加到aliases
数组中。(如果你想使用静态接口CssMin::minify(...)
,则必须有此设置)
##使用
//through the Ioc
$cssmin = App::make("cssmin");
$cssmin->minify(
[
'path/to/file1.css',
'path/to/file2.css'
],
'output/path',
true,// (optional) remove comments or no
false // (optional) concat the resulted files into one file 'all.min.css'
);
//Through the Facade
CssMin::minify(
[
'path/to/file1.css',
'path/to/file2.css'
],
'output/path',
true,// (optional) remove comments or no
false // (optional) concat the resulted files into one file 'all.min.css'
);
##待办:编写测试