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