Do I need to use the smarty template in the PHP Framework?-php Tutorial

Source: Internet
Author: User
Do I need to use the smarty template in the PHP framework? It is a habit to use templates in java development. many people hate JSP in the java web development stack. although sun has introduced JSF, it always feels that it has never been used. In the java website development tutorial, we recommend using Velocity for the two frameworks Struts in SSH, while in Spring, we recommend using fre. Do we need to use the smarty template in the PHP framework?

It is common to use templates in java development. many people hate JSP in java web development stack. although sun has introduced JSF, it is not always time to come out, it has never been used. In the java website development tutorial, Velocity is recommended for the two frameworks Struts in SSH, and freemarker is recommended for Spring. A variety of template engines are even available in the front-end javascript language.

?

CodeIgniter, a lightweight PHP framework, clearly states:

Note: it is faster to use PHP only in view files, so CodeIgniter does not require you to use this class. However, some developers prefer to use the template engine when working with designers who are difficult to use PHP.

?

Is template a new direction of framework development? When using Smarty, you can still manually write the template or use the built-in framework.

?

Many developers think: "I just use the CI template. I think the CI Template method is great ".

?

"Write your own template !".

?

Some people think that templates should not be used. these developers mainly consider performance.

?

"The most performance-effective template is to directly echo the template instead of the template ".

?

However, the use of templates does not necessarily achieve performance. "I generate html directly, and it is necessary to generate a larger project ".

?

The template persistence users also provide other reasons:

?

"This change does not affect the template designer, and the content will still be output to the template accurately. Similarly, the program logic will not be affected if the artist wants to completely redo the interface. This is the original story in the smarty manual. Templates also have their advantages. The code logic is distinct from the page ."

?

Some people complain about the template: using the template, I feel that I will write a lot of useless code. In fact, as long as the code is used to implement the function, it is useful.

?

Finally, a couplet is for programmers:

?

Uplink: born for the system, die for the framework, and strive for debug for a lifetime?

Downlink: loss of eating symbols, case-insensitive, and finally dead on demand !?

Horizontal approval: Cup programmers.

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.