The template technology of the php template smartyphp should be mentioned frequently. like the famous phplibfasttemplate, the MVC model is basically implemented, and the work cannot be solved, currently, there are not many templates, because there are another template class smarty, smarty and phplib. The main difference between these template classes is that smarty adds the cache function, and each time it hits SMARTY
Php template smarty
Php's template technology should be mentioned frequently. like the famous phplib fasttemplate, it basically implements the MVC mode, which is hard to work, currently, there are not many templates, because there are another template class smarty, smarty and phplib. The main difference between these template classes is that smarty adds the cache function, you do not need to re-compile the template every time you open the program.
The following is my opinion on smarty.
Smarty is not the best, because the compiled template is too bloated. you can open the template page after smarty compilation, which contains some objects and is very complex, PHP processes object variables very slowly, and the compiled template does not need to be viewed by programmers. how complicated it will affect the speed.
In addition, to use smarty, you also need to be familiar with some special syntaxes, such as learning a new language (although not very complicated, it is also very troublesome ).
Finally, smarty is very dead and almost cannot define the desired template tag.
The following describes a good template technology. Discuz! .
Discuz! The template function is to directly replace the tag in the template with the php syntax. Finally, the execution result of the program is actually a mix of php and html programs, so that the program speed is the fastest, no one will disagree with this statement.
Discuz! The template function is very concise, with only a few dozen lines. compared with smarty, it is much more concise. for such concise code, it is very easy to add new functions or labels, MVC is also implemented, and the speed is definitely faster than smarty. The perfect combination of flexibility and high speed is achieved.
Discuz! If you are interested in the/include/template. php file in the source code of the template function, you can study it.