Smarty is a php template engine. More precisely, it separates logic programs from external content and provides an easy-to-manage approach. You can describe different roles for both the application and the artist, because in most cases they cannot be the same person. For example, you are creating a Web page for browsing news, news headlines, tab bars, authors, and content that are content elements that do not include how they should be presented. In the Smarty program, these are ignored. Template designers edit templates, combining HTML tags and template tags to format the output of these features (HTML table, background color, font size, style sheet, and so on). One day programmers want to change the way the article is retrieved (that is, the change in program logic). This change does not affect the template designer, the content will still be accurately output to the template. In the same way, the artist eats too much and wants to completely redo the interface without affecting the program logic. As a result, programmers can change the logic without having to rebuild the template, and the template designer can change the template without affecting the logic. Now let's briefly say what Smarty is not doing. Smarty does not attempt to separate the logic completely from the template. If the logic program is strictly used for page performance, then it will not have problems in the template. One suggestion: To keep the application logic away from the template, the page representation logic is far away from the application logic. This will make the content easier to manage later and the program can be upgraded more easily. One of the features of Smarty is "template compilation". This means that Smarty read the template files and then use them to create PHP scripts. These scripts are created and will be executed later. Therefore, the parsing of template files is not spent, and each template can enjoy such as Zend Accelerator (http://www.zend.com) or PHP accelerator (http://www.php-accelerator.co.uk). Such a PHP compiler cache solution. Some features of Smaty: Very, very fast! Doing this chore with the PHP parser is effective without the need for redundant template parsing, simply compiling the modified template files only once to edit the ' custom function ' and custom ' variables ', So this template language can be fully extensible to set the template delimiter itself, so you can use {}, {{}}, <!--{}-->, etc., such as IF/ELSEIF/ELSE/ENDIF statements can be passed to the PHP parser, so {if ...} The expression is simple or complex, and you like it. If allowed, an infinite nesting engine can be customized between sections. You can embed PHP code into your template file, although this may not be necessary (not recommended) built-in cache supports standalone template files customizable cache handler plug-in architecture
1, smarty Template Introduction Description