1. Go to this page and download the library: Download audriusdob/yii2-minify-view library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
audriusdob / yii2-minify-view example snippets
<?
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
'compress_options' => ['extra' => true], // options for compress
]
]
];
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.