[UCHome Secondary Development] template Parsing

Source: Internet
Author: User

The uchome template file is located in the/template folder. Each template file has a separate folder. The default template folder is default.

1. template usage Configuration

Configure in config. php under the root directory to determine the template used by the system, as shown below:

 
De> De> De> $ _ SC De> De> [ De> De> 'template' De> De>] = De> De> 'default' De> De>; De> DE> // select the template directory De>

2. Processing templates

When the template file is used in the program, first go to the template cache directory/DASearch for template cache files under TA/tpl_cache. The template cache file name should be "template _ template directory name_template file name. php ". If yes, the cached template file is used directly. If no, the corresponding template file is parsed and the template cache file is generated before use.

3. template Parsing

Template Parsing is implemented by calling the parse_template function in the function_template.php file under the/source directory.

When reading the template file (.htm), replace the regular expression with the corresponding PHP code, generate a standard PHP file, and save it to the template cache directory/DATa/tpl_cache/for later use.

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.