Book Review: Smarty PHP Template Programming and Applications
(Page 2 out of 2)Chapter eight is the first part of the developer's part, and that's where it started getting interesting for me. This is logical of course, since I'm a developer at heart, and not really a designer. In this chapter you will learn everything about the Smarty library itself: the built-in Smarty variables and methods. These variables and methods allow you to change the way Smarty works, and the author does a good job of explaining each variable and method.
In chapter nine we are introduced to Smarty's inbuilt caching functionality and several different caching features are discussed, such as dynamically caching a template section, using caching groups, creating a custom cache handler and more. This chapter is one of my favorites, because it's clear to me that the author knows exactly what he's talking about. I've read many caching articles and tutorials, and often they are very half-assed, but this chapter provides a strong base for a good caching strategy, and the last part of the chapter even introduces three tools for profiling/testing your website.
Chapters ten and eleven are mainly about extending Smarty with your own modifiers, functions and filters, and several examples are given to demonstrate the use of your own plugins. Although these chapters contain useful information, I doubt you'll ever have to write your own filter or function. I've only had to write a custom modifier a few times, and it's been really easy: just copy an existing modifier and modify it.
In chapter twelve, the last one, you are shown how to make your website ready for internationalization with PHP's Gettext library and Smarty's inbuilt Gettext features. Everything is demonstrated with examples, and it looks really useful to me, but I have to wonder how practical it is, and it probably has the same limitations as most internationalization libraries have. It's definitely worth reading though if you have to create a multi-language website.
Final Verdict
If you're looking for a good book on Smarty, this one should definitely be on your list. This book takes you through every feature that Smarty offers in an easy-to-understand and practical way, with plenty of clear and concise examples to make it even easier to understand.
It doesn't matter if you're a developer who wants to start using Smarty or if you're a designer who has to start working with Smarty, this book is a great resource for both and thanks to a clear division in the book it's easy to learn about Smarty as a developer or designer.
There aren't many negative things to say about this book, but it isn't perfect either. Sometimes things are explained multiple times, with might cause some slight annoyance, and in some cases parts of an example aren't explained at all, which leaves you wondering what something is used for.
To sum it all up, this book is certainly worth the money, and I can definitely recommend it if you're looking to get started with Smarty.
Lastly, I'd like to thank the publisher of the book for sending me a free copy for reviewing purposes.
July 8th, 2006 at 5:36 pm
PHPit.net: Book Review: Smarty PHP Template Programming and Applications