Class lajax\assetminifier\Minifier
Inheritance | lajax\assetminifier\Minifier » yii\base\Object |
---|---|
Available since version | 1.0 |
Class performing the minification of asset files.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$createGz | boolean | Creating corresponding . | lajax\assetminifier\Minifier |
$css | lajax\assetminifier\minifiers\MinifierInterface | Object performing minification StyleSheet files. | lajax\assetminifier\Minifier |
$js | lajax\assetminifier\minifiers\MinifierInterface | Object performing minification of JavaScript files. | lajax\assetminifier\Minifier |
$workPath | string | Type of processed asset file (basePath|sourcePath). | lajax\assetminifier\Minifier |
Public Methods
Method | Description | Defined By |
---|---|---|
minifyCss() | Minification of js files of the assetBundle received as a parameter. | lajax\assetminifier\Minifier |
minifyJs() | Minification of js files of the assetBundle received as a parameter. | lajax\assetminifier\Minifier |
Protected Methods
Method | Description | Defined By |
---|---|---|
getMinifierByExtension() | Returns the minifier object based on extension. | lajax\assetminifier\Minifier |
minify() | Function performing the minification of asset files. | lajax\assetminifier\Minifier |
Constants
Constant | Value | Description | Defined By |
---|---|---|---|
WORKPATH_BASE | 'basePath' | The processed files are located in web/assets/* Recommended for runtime conversion of less, scss, sass, styl, coffee, ts. | lajax\assetminifier\Minifier |
WORKPATH_SOURCE | 'sourcePath' | Processed files are same as source files. Recommended in case of css and js files. Effectively replaces forceCopy. | lajax\assetminifier\Minifier |
Property Details
Creating corresponding .gz files for asset files.
Object performing minification StyleSheet files.
Object performing minification of JavaScript files.
Type of processed asset file (basePath|sourcePath).
lajax\assetminifier\Minifier::WORKPATH_SOURCE // If we only use js anc css.
lajax\assetminifier\Minifier::WORKPATH_BASE // If we convert css or js files during runtime.
Method Details
Returns the minifier object based on extension.
lajax\assetminifier\minifiers\MinifierInterface getMinifierByExtension( $extension ) | ||
$extension | string |
Function performing the minification of asset files.
string minify( $bundle, $filename ) | ||
$bundle | \yii\web\AssetBundle | |
$filename | string |
Minification of js files of the assetBundle received as a parameter.
\yii\web\AssetBundle minifyCss( $assetBundle ) | ||
$assetBundle | \yii\web\AssetBundle |
Minification of js files of the assetBundle received as a parameter.
\yii\web\AssetBundle minifyJs( $assetBundle ) | ||
$assetBundle | \yii\web\AssetBundle |