Download the PHP package tquant/yii2-asset-combiner without Composer
On this page you can find all versions of the php package tquant/yii2-asset-combiner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-asset-combiner
Asset combiner for Yii 2
Yii 2 extension to compress and concatenate assets
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
file.
Configuring
Note: to use UglifyJsFilter
and UglifyCssFilter
you must have installed
UglifyJs and UglifyCSS
Console command
View behavior
Usage
Precompiled in console
You can use the first configuration option and use this extension as console command
Execute this command every time when files changed and include generated file into your web config. This will concat and compress all files into one group (one js and one css) for each asset.
Compiled on the fly
You can use the second configuration option and compress and concatenate assets on the fly for each page. In this case all files in all assets registered on requested page will be concatenated into N groups. For example, you have one shared asset for all pages. Mark it as monolith:
Now this asset files and all it dependencies will be combined into one group (one js and one css). All others assets on page will be combined into second group.
So as result you will have two js and two css files for each page. First pair will be common for all pages, and second - unique for each page.
Simple file concatenation is pretty fast, but if you want to compress files, then this option is not very good, even though the recombination assets into group happens only when files is changed.
Combined compilation
If you want concatenate and compress files while maintaining performance then you can use both options.
Compress all assets in console after each changes:
And then concatenate already compressed files for each page on the fly