|All reviews||Smarty PHP Template Programming and Applications||Latest reviews||Best sellers ranking|
Smarty PHP Template Programming and Applications
João Prado Maia
Week: 206 All time: 20
manuellemos.netPHP template engines have always been an hot topic. I guess it is accurate to say there are hundreds of PHP classes and scripts that implement template engines.
Smarty is by far the most popular PHP template engine. I suppose it is fair to say that the history of PHP template engine can be split in "before Smarty" and "after Smarty".
Smarty was innovative in many aspects. I think the most important aspect is the way it makes intelligent use of caching of processed templates and their output to achieve greater page delivery performance results.
Despite Smarty was first released in 2001, "Smarty, PHP Template Programming and Applications" is the first book that I have found dedicated exclusively to Smarty.
This book was written having in mind two types of audience: the Web page designers and the Web application programmers. After a couple of introductory chapters, there are several chapters written for Web page designers followed by several chapters more for Web application programmers.
This is a very good structure. It helps each type of reader to find the aspects that concern more their kind of work. It also reflects the fact that Smarty was thought to promote the separation of tasks between Web page designers and Web application programmers.
The introductory chapters cover the usual subjects regarding Smarty feature overview, Smarty installation and the role that Smarty can play in a three tiered application, on which the layers for business logic, presentation logic and data access are separated.
One section that brought my attention is about how Smarty compares to other PHP template engines. According to one of the book authors, only PHP Savant can be considered a true competitor of Smarty.
PHP Savant uses PHP itself as the template language. Despite it does not require learning a new template language like Smarty requires, the book author explains that PHP Savant cannot be considered a secure option when the Web page designer that produces the templates cannot be trusted. This is certainly an important aspect to consider when choosing a template engine.
The chapters for Web page designers provide an introduction to the concepts that they must know before start working with Smarty, creation of templates, taking advantage of Smarty advanced features to achieve more complex effects, and how to debug templates to fix eventual problems.
The chapters for Web application programmers are necessarily more technical. They cover the functions and variables of Smarty API, using the caching support to enhance the performance of the template engine, extending Smarty with plug-in filters, and developing internationalized applications.
Whether you are working mostly on Web page design or Web application programming, this book provides great in-depth knowledge about how to take the most of Smarty using templates to separate presentation from business logic of PHP applications. There should be more books like this that provide excellent coverage of all that matters about popular PHP developer tools and packages like Smarty.
No comments were submitted yet.