Smarty Advantages and Disadvantages

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.