Need to use Smarty templates in PHP frameworks?

Source: Internet
Author: User
Do I need to use the Smarty template in the PHP framework?

The use of templates in Java development has become commonplace, and many people hate the JSP in the Java Web development stack, and although Sun has introduced JSF, it always feels like it's not a good time to use it. In the Java Web site development tutorial, the two major framework Struts in SSH recommend using Velocity, while in Spring it is recommended to use Freemarker. Even in the front-end language JavaScript There are a variety of template engines.

?

In PHP's lightweight framework CodeIgniter, it is clear that:

Note: Because it is faster to use pure PHP in the view file, CodeIgniter does not require you to use this class. However, some developers are more likely to use the template engine when working with designers who are having trouble with PHP.

?

is the template a new direction for the development of the framework? Use Smarty, or your own handwriting template, or with a frame.

?

I have a lot of developers think: "With the CI template, I think CI is a very cool mode."

?

"Template to write yourself!" ”。

?

Others think that templates should not be used, and these developers are primarily concerned with performance.

?

"The most performance of the template is not template, direct echo."

?

However, the use of templates does not necessarily achieve performance, "I am directly generated HTML, larger projects are necessary to generate a".

?

The users of the template also gave other reasons:

?

"This change does not affect the template designer, the content will still be accurately output to the template. In the same way, the artist eats too much and wants to completely redo the interface without affecting the program logic. This is the exact words in the Smarty Handbook. The template also has his benefits. Code logic and page-clear. ”

?

There are also people complaining about templates: using templates, it feels like writing a lot of useless code. In fact, as long as the code to implement the function, it is useful.

?

Finally, a couplet is dedicated to programmers:

?

Allied: For the system of life, for the framework of the death, for the debug for a lifetime?

Xia Lian: Eat symbol of the loss, on the case, the last death in demand!?

GUANGPI: Cup with programmer.

  • 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.