Template engine for PHP

Source: Internet
Author: User
Tags smarty template

To design an interactive website, we need to focus on two main issues: the graphical user interface and the business logic, respectively. For example, a standard Web development team consists of two or three artists and three programmers, the design process is: The designer created the project's website interface template, and then handed it to the PHP programmer, the programmer on the basis of the appearance of the use of Php+mysql to implement the business logic of the program, The project is then returned to the artist's hand to render the page.

Bottom line: The Smarty engine is a tool for separating the logical and presentation layers of the Web application, and it is also a separate role for the application staff and the artist. So programmers and artists need to learn to use smarty, but the focus of learning is different.

Why choose the Smarty template engine

1. The template engine is just a project developed using PHP

Phplib

Inside the company has its own template engine

You don't have to write your own template engine.

Smarty www.smarty.net smarty.php.net

How to use, who is using

Art Staff
1. Write templates, HTML CSS JavaScript
2. Use Smarty to perform logic to put variables, traverse and judge data

PHP Programmer
1. PHP program is the same as the original (connection data, diagrams, files)
2. Load the Smarty engine and create the object

3. Assigning variables to the engine (sub-data)

4. Show that template

Smarty Installation


Smarty of the early stage

Smarty Precautions for use
1. Because our access is PHP file, and the template is included in PHP content, so in the template using pictures, CSS files, JS files, to access the PHP directory is the main demo directory containing templates
2. All display templates (or include in templates) are based on the template directory specified in the Smarty object

3. If you want PHP programs in each directory to load Smarty and use smarty specified templates and compile directories, the only way is to use absolute paths.

Template engine for PHP

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.