The template for PHP is really a tricky thing to say. A random number of about 20 or more options, light pear contains 5 of different templates, it is really a headache.
Do not say that the good one, choose a template before the best to figure out what the real purpose of the template? Simply put, the core purpose of the template is a team work. There are two main modes of action:
1. Separating HTML and PHP makes it much more enjoyable for web designers and PHP programmers to collaborate.
2, the separation of display logic and the logic of things, making the core transaction logic changes and application expansion more easily and flexibly, which means that the cooperation between programmers more enjoyable. (This is often overlooked or misunderstood, always think that the PHP out of the HTML is called separate display logic and the logic of things, if so why did you let PHP and HTML mixed together? )
Figuring out what the real purpose of the template is, it's easy to make the right choice.
If you're the only PHP programmer who needs to work with other web designers, choose a template that separates HTML from PHP, Phplib (now seems to be integrated into Pear http://pear.php.net/package/ Html_template_phplib) or
Fasttemplate is such a thing, very simple and easy to start.
If your website interface is ugly and mostly done by programmers, but the function is more complex and need a powerful extension function, need to separate various levels including display logic, then do not use anything extraordinary, PHP itself is the best template. It is important to note that in this case, you want to design your program very carefully, always remember to detach not PHP and HTML but transaction logic (business logic) and display logic (presentation logic). That's why I've always been very resistant to Smarty, because the Smarty syntax is so complex and powerful that it's almost reinventing a scripting language thing (even PHP programmers have to learn it again). More puzzling is that the more powerful the script, the easier it is to have the transaction logic (business logic) and display logic (presentation logic) mixed together, destroying the original intention of the template.
If you want to separate HTML from PHP, get a better visual design, and think that the entire system has a very powerful scalability to adapt to html,xml,wml various interfaces, and that you don't have to learn complex syntax to provide high operational efficiencies, then this is a fairly challenging issue. The bad news is that there is no mature template to really achieve this requirement, the good news is that it is not difficult to complete such a template, if you have tried Zope or ColdFusion will find this template shadow,
(Wact http://wact.sourceforge.net/and Phptal http://phptal.sourceforge.net/are in this direction, should be very promising).
There are two main ways to combine template and data (template invocation): Push and pull way.
The push is to use PHP to push data to the template, which means that programmers need to explicitly assign values to each variable in the template and tie them up.
And pull the way like the PHP and HTML mixed together, template species of variables to take the initiative to drag data in.
When it comes to templates, there are two other things to mention:
Phphtmllib and Quickform (http://pear.php.net/package/HTML_QuickForm) are the traditional ways to complete HTML pages through a variety of page artifacts The entire structure of the page is completely in the hands of programmers, perhaps many programmers who have written traditional GUI desktop programs prefer this approach.
A more beautiful scheme
If you do business software, Flash should be a more beautiful solution (don't be mistaken, don't think you know that PHP supports the Ming and SWF libraries can dynamically generate Flash, which is not what I'm talking about.) I want to say is the support flash Remoting, this kind of thing is really meaningful PHP and flash combination. The Flash section is completed by the visual designer, and the PHP programmer sends the data to the Flash client via Flash remoting.
There are currently two options:
amfphp
http://www.amfphp.org/
Because the Macromedia Flash Remoting transmits data using a unique and more efficient data format, amfphp constructs the corresponding PHP class on the server side to receive it by analyzing the data format. Parsing and encoding the data to achieve the function of exchanging information (like Samba, it should belong to a Hacking bar).
Phpobject
http://ghostwire.com/resources/phpobject/
Phpobject uses an alternative method of transmitting data through open format soap by embedding some ActionScript components in Flash.