Php template smarty

Source: Internet
Author: User
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.

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.