How to use JS and CSS optimization tools Minify in PHP _ PHP Tutorial

Source: Internet
Author: User
How to use JS and CSS optimization tools Minify in PHP. To reduce HTTP requests, we often need to merge and compress multiple JS and CSS files, next we will record the PHP source code for implementing this function and the usage of Minify, an open-source project. I. to reduce HTTP requests, we often need to merge and compress multiple JS and CSS files, the following is a record of the PHP source code for implementing this function and the usage of Minify, an open-source project.

1. for code for merging and compressing multiple JS and CSS files, see

1. a command to quickly merge JS and CSS files

2. PHP merges multiple JS and CSS files to reduce HTTP requests (prototype)

II. usage of Minify

1. download the latest version of minifyfrom code.google.com/p/minify/and decompress it. copy the "min" folder along with the content to the DOCUMENT_ROOT Directory (website and directory ).

You can modify the folder name "min"

2. configure g parameters in "min/groupsConfig. php ".

Return array (
// 'Js' => array ('// js/file1.js',' // js/file2.js '),
// 'Css '=> array (' // css/file1.css ',' // css/file2.css '),
);

3. you can reference the web page as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.