Introduction to PHP Resource Management Framework Assetic_PHP Tutorial

WBOY
Release: 2016-07-13 10:28:23
Original
907 people have browsed it

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.

www.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...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!