PHP code example of slinstj / yii2-assets-optimizer
1. Go to this page and download the library: Download slinstj/yii2-assets-optimizer 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/ */
slinstj / yii2-assets-optimizer example snippets
<?
return [
// ...
'components' => [
// ...
'view' => [
'class' => '\slinstj\assets\optimizer\View',
]
]
];
<?
return [
// ...
'components' => [
// ...
'view' => [
'class' => '\slinstj\assets\optimizer\View',
'minify' => true, // Could be '!YII_DEBUG' for example.
'publishPath' => '@webroot/yao', // Folder where optimized file(s) will be published in.
'publishUrl' => '@web/yao', // Web acessible url. Must be in accord to 'publishPath'.
]
]
];