Class lajax\assetminifier\Minifier

Inheritancelajax\assetminifier\Minifier » yii\base\Object
Available since version1.0

Class performing the minification of asset files.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined 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

Hide inherited methods

MethodDescriptionDefined 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

Hide inherited methods

MethodDescriptionDefined By
getMinifierByExtension() Returns the minifier object based on extension. lajax\assetminifier\Minifier
minify() Function performing the minification of asset files. lajax\assetminifier\Minifier

Constants

Hide inherited constants

ConstantValueDescriptionDefined 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

$createGz public property

Creating corresponding .gz files for asset files.

$css public property

Object performing minification StyleSheet files.

$js public property

Object performing minification of JavaScript files.

$workPath public property
string $workPath self::WORKPATH_SOURCE

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

getMinifierByExtension() protected method

Returns the minifier object based on extension.

lajax\assetminifier\minifiers\MinifierInterface getMinifierByExtension$extension )
$extension string
minify() protected method

Function performing the minification of asset files.

string minify$bundle$filename )
$bundle \yii\web\AssetBundle
$filename string
minifyCss() public method

Minification of js files of the assetBundle received as a parameter.

\yii\web\AssetBundle minifyCss$assetBundle )
$assetBundle \yii\web\AssetBundle
minifyJs() public method

Minification of js files of the assetBundle received as a parameter.

\yii\web\AssetBundle minifyJs$assetBundle )
$assetBundle \yii\web\AssetBundle