Dynamic code and front-end code are completely separated. The template only contains pure front-end code (html, css) and identifiers that replace dynamic code. Pure dynamic code is written in the core, but there is a parameter that makes the code block correspond to the identifier in the template, and the two are matched through a parser. This parser is the template engine . The following introduces the template engines commonly used in PHP.
1. Smarty
Smarty is characterized by compiling templates into PHP scripts and then executing these scripts. Very fast and very flexible.
2. Heyes Template Class
A very easy-to-use, yet powerful and fast template engine that helps you separate page layout and design from code.
3. FastTemplate
A simple variable interpolation template class, which analyzes your template and separates the variable values from the HTML code.
4. ShellPage
A simple and easy-to-use class that can make your entire website layout based on template files. Modifying the template can change the entire site.
5. STP Simple Template Parser
A simple, lightweight and easy-to-use template parsing class. It can assemble a page from multiple templates and output the resulting page to the browser or file system.
6. OO Template Class
A cash-oriented template class that you can use in your own program.
7. SimpleTemplate
A template engine that can create and structure websites. It can parse and compile templates.
8. bTemplate
A short but fast template class that allows you to separate PHP logic code from HTML decoration code.
9. Savant
A powerful and lightweight PEAR compatible template system. It is non-compiled and uses the PHP language itself as its template language.
10. ETS - easy template system
A template system that can reorganize templates using exactly the same data.
11. EasyTemplatePHP
A simple but powerful template system for your site.
12. vlibTemplate
A fast, versatile template system that includes a cache and debugging class.
13. AvanTemplate
A multi-byte safe template engine that takes up very little system resources. It supports variable substitution, and content blocks can be set to show or hide.
14. Grafx Software’s Fast Template
A modified version of the Fast Template system, which includes caching functionality, debugging console, and silence removal for assignment blocks.
15. TemplatePower
A fast, simple and powerful template class. Key features are nested dynamic block support, block/file inclusion support and showing/hiding unassigned variables.
16. TagTemplate
The functionality of this library is designed to work with template files while allowing you to retrieve information from HTML files.
17. htmltmpl: templating engine
A template engine suitable for Python and PHP. It is aimed at web application developers who want to separate code and design in their projects.
18. PHP Class for Parsing Dreamweaver templates
A simple class for parsing Dreamweaver templates, used in custom modules of Gallery 2 and WordPress.
19. MiniTemplator (Template Engine)
A compact template engine for HTML files. It has simple syntax for template variables and block definitions. Blocks can be nested.
20. Layout Solution
Simplify website development and maintenance. It has commonly used variables and page elements so that you don't need to repeat page layout work.
21. Cached Fast Template
It has been incorporated into FastTemplate, allowing you to cache template files and even cache different specifications on separate chunks of content.
22. TinyButStrong
A template engine that supports MySQL, Odbc, Sql-Server and ADODB. It contains 7 methods and two properties.
23. Brian Lozier’s php based template engine
Only 2K in size, very fast and object-oriented design.
24. WACT
A template engine that separates code from design.
25. PHPTAL
An XML/XHTML template library under PHP.
I hope that the summary of the above content can help you.