appmake/yii2-minify-view

带有压缩 CSS 和 JS 的 Yii2 视图组件

安装: 53

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

dev-master 2015-07-09 21:42 UTC

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
		]
	]
];