appmake / yii2-minify-view
带有压缩 CSS 和 JS 的 Yii2 视图组件
dev-master
2015-07-09 21:42 UTC
Requires
- mrclay/minify: 2.2.*
- yiisoft/yii2: 2.0.*
This package is not auto-updated.
Last update: 2024-09-28 17:38:34 UTC
README
安装
安装此扩展的首选方式是通过 composer。
运行
php composer.phar require --prefer-dist appmake/yii2-minify-view "*"
或添加
"appmake/yii2-minify-view": "*"
配置
<? return [ // ... 'components' => [ // ... 'view' => [ 'class' => '\rmrevin\yii\minify\View', 'enableMinify' => !YII_DEBUG, 'web_path' => '@web', // path alias to web base 'base_path' => '@webroot', // path alias to web base 'minify_path' => '@webroot/minify', // path alias to save minify result 'js_position' => [ \yii\web\View::POS_END ], // positions of js files to be minified 'force_charset' => 'UTF-8', // charset forcibly assign, otherwise will use all of the files found charset 'expand_imports' => true, // whether to change @import on content 'compress_output' => true, // compress result html page ] ] ];