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, is it recommended to use the smarty template in the PHP framework for the two frameworks Struts in SSH?
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.