Smarty Advantages:
1. Speed: The program written in Smarty can get the maximum speed improvement, which is relative to other template engine technology.
2. Compiled: The program written in Smarty is compiled into a non-template PHP file at runtime, this file is a mixture of PHP and HTML, the next time you access the template, the Web request directly into this file, Instead of recompiling the template (in case the source program has not changed)
3. Caching technology: Smarty chooses a caching technology that caches the HTML files the user eventually sees as a static HTML page, and when the cache property of the Smarty is set to True, The user's Web request is converted directly to this static HTML file during the Cachetime period set by Smarty, which is equivalent to calling a static HTML file.
4. Plug-in technology: Smarty can customize the plugin. Plugins are actually some of the custom functions.
5. If/elseif/else/endif can be used in the template. The template file can be easily reformatted by using a judgment statement.
Smarty Disadvantages
1, waste memory. such as $_smarty_tpl_vars = $this->_tpl_vars, two variables, takes up more than twice times of memory (although unset dropped after use).
2, waste the processor. The Smarty syntax is finally converted to a PHP script for output. Conversion to waste processor resources. If the script is in the compiled cache, it is wasted to determine if there is a compiled script's processor time.
3, the syntax is not compatible. Smarty has its own set of syntaxes, incompatible with PHP, and incompatible with other template languages. The template engine also does not have a unified common syntax for fragmentation.
Smarty Advantages and Disadvantages