Download the PHP package processfast/yii2-minify-view without Composer
On this page you can find all versions of the php package processfast/yii2-minify-view. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-minify-view
Yii 2 Minify View Component
Purpose of the Yii2 extension
The main feature of this component is to concatenate and compress [GZIP] JS and CSS files listed in "AssetBundle" and allow application an option to upload them to AWS S3 bucket directly from minify folder on file generation.And present copressed files from S3 bucket to browser. Concatenation and compression of all files will be done on first time loading after deployment, for all the next requests assets will only be requested from S3 bucket.Optionally console request can also be sent to have all the assets coming from S3 bucket directly. Console request must be part of continuous deployment script.
Required to work accurately
- It works with layouts. For instance different layouts can have different JS & CSS files which can be listed in different AssetBundle.
- There should be only one main AssetBundle which has all other asset bundles as dependecies. Please check here how I have managed my assets.
- All JS & CSS files [ mostly JS pluggins ] used in particular layout whether it belongs to a particular page which only required on widget initialization must be also added at in the main Asset file under dependency.
Code Status
Support
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
file.
Configure
Documentation/Explanation of the Configuration Options
New Configuration Options
Dependecnies
- "yiisoft/yii2": "2.0.*",
- "mrclay/minify": "~2.2",
- "fedemotta/yii2-aws-sdk": "2.*"
Yii2 configuration or structure that is expected for this extension to work
Example of Asset bundles dependencies ( Required )
By giving dependencies and loading all JS/CSS files throught web application in a uniform sequence will create uniform minified JS/CSS files from extention for all pages as all pages have same JS/CSS files with same sequence. As the final name of JS/CSS file depends on the file content and file path so it is important to have configuration in this way.
This is just example of my "bundles-minify.php" which handles dependency you can create yours on the basis of your asset bundles.
This is some fix I have to done at my main.php ( Required )
-
Not allowing JS/CSS files to be load at AJAX requests as all of the needed will be there of the first request or main request.
- Another thing application needed folder names generated from backend/frontend have same name. As backend path will have "ROOT/backend/../assets" name can be different to solve that added this fix. Which will create same named folders for backend and frontend. Folder names will be same.
These extra functions added at "\common\components\Helper" ( Required )
- This are the function used in previous step so need to put them in "\common\components\Helper".
My AssetMinifyController ( Console Controller ) ( Optional )
This will be helpfull if you have continuous deployment, now you want to generate all the assets from a console request and compress and concate them and upload them to S3 bucket. Just need to add this controller and call "php asset-minify/init" in continuous deployment script.