Let's talk about the template selection in PHP program development. The PHP template is indeed easy to say and do. There are more than 20 choices for a random number. pear contains 5 different templates, which is really a headache for PHP templates. There are more than 20 options for a random number. pear contains 5 different templates, which is really a headache.
Never let everyone say that this is a good thing. before you select a template, you 'd better find out what the real purpose of the template is? Simply put, the core purpose of a template is a team work. There are two main ways to work:
1. separating HTML and PHP makes it easier for web designers to cooperate with PHP programmers.
2. the separation of display logic and Transaction logic makes it easier and more flexible to change the core transaction logic and extend the application. that is to say, it makes the cooperation between programmers more pleasant. (This is often overlooked or misunderstood. I always think that the separation of display logic and Transaction logic is to extract PHP from HTML, if so, why should PHP and html be mixed together ?)
It is easy to make the right choice by figuring out what the real purpose of this template is.
If you have only one php programmer but need to work with other web designers, you can select a template that can separate HTML and PHP, phplib (now seems to have integrated http://pear.php.net/package/HTML_Template_PHPLIB into Pear) or
FastTemplate is easy to use.
If your website interface is ugly and mainly completed by programmers, but the functions are complicated and more powerful extension functions are required, you need to separate all layers including the display logic, so don't use anything special. PHP itself is the best template. Note that in this case, you must design your program very seriously and always remember that what you want to separate is not PHP and html but business logic) and presentation logic ). This is why I have always been very resistant to something like Smarty, because the syntax of this Smarty is too complicated and too powerful, and almost re-invented a scripting language, (Even PHP programmers have to learn it again ). What is even more confusing is that the more powerful the script, the more likely it is to mix the Transaction logic and the presentation logic, undermining the original intention of the template.
If you want to separate HTML from PHP, get a better visual design, and have a very powerful extension capability for the entire system to adapt to various html, xml, and wml interfaces, and you don't need to learn complex syntaxes and provide high running efficiency. this is a very challenging problem. Bad news is that no mature template can really meet this requirement. The good news is that it is not difficult to complete such a template, if you try Zope or ColdFusion, you will find the shadow of this template,
Bytes. There are more than 20 options for a random number. pear contains 5 different templates, which is really a headache...