Phpcms Template Generation Principle

Source: Internet
Author: User
Tags php template

Phpcms template Generation Principle 2009-09-25 16:14phpcms is a powerful website management system. After the time, I want to manage, use, redevelopment and so on to straighten out. This short article first introduces the template mechanism of PHPCMS.

The so-called site template, is to generate the "mold" of the Web page, mainly including fixed images, tables, colors and other art styles, as well as the data to be exported from the database label, there is a simple phpcms definition of the syntax (also can be very complex PHP syntax). Phpcms each site of each column, can be set up a different template, the final column of the page is a "mold" out, should be this column of the page appearance, style is consistent.

The Phpcms templates are placed under the module's name, and the most important content templates, such as news, products, information, images, downloads, videos, and home pages, are placed under the Phpcms directory.

Phpcms directory, header.html,footer.html is the page header and footer template for all Web pages, index.html is the homepage template. File category.html and list.html is the News Model column homepage and column list page, because PHPCMS think the news model is the most important bar, so the template of the news model does not have a suffix, the other models of the column home page and the list of pages to take the suffix, such as category-info.html,list-info.html, this is the Information Column Model column homepage, column list page, other similar. For some extension models, such as the Yellow Pages, the templates are below the \yp\ directory.

Let's talk about the process of creating a Web page with templates.

PHPCMS Web pages allow static and dynamic Web pages to be generated, whether static or dynamic, and the style is defined by the template. First, the site administrator to put the template of the corresponding model under the template directory, and in the management background set template scheme, after determining, PHPCMS will compile the template into the corresponding PHP file, save to \data\cache_template below. The compilation process is actually a few statements, the template of the PHPCMS statement into a PHP statement, the data label translated into SQL database operation statement, which is the standard PHP file, the server can be directly executed. For dynamic Web pages, the work is done. Static Web page is also to do a "permutation", execute php template file, according to PHP syntax to execute SQL statements, the results of the output of the SQL statement and the template structure department into a Web page file (HTML), and write to the server space inside.

This is the PGPCMS system template mechanism, flexible use of this mechanism, you can set different sub-columns flexible template. Phper also note that, directly to \data\cache_template\ the following php template file is useless, you must change \templates\ the following static template.

Phpcms Template Generation Principle

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.