Assetic is a PHP resource management framework for merging and compressing CSS/JS resources.
The sample code is as follows:
Copy the code The code is as follows:
use AsseticAssetAssetCollection;
use AsseticAssetFileAsset;
use AsseticAssetGlobAsset;
$js = new AssetCollection(array(
new GlobAsset('/path/to/js/*'),
new FileAsset(' /path/to/another.js'),
));
// the code is merged when the asset is dumped
echo $js->dump();
Using this method to merge resources can reduce the number of browser requests for resources, reduce resource download size, and speed up the site. Also eliminates a lot of unnecessary HTTP requests.
http://www.bkjia.com/PHPjc/788641.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/788641.htmlTechArticleAssetic is a PHP resource management framework for merging and compressing CSS/JS resources. The sample code is as follows: Copy the code The code is as follows: ?php use AsseticAssetAssetCollection; use Asseti...