The Definitive Guide to Symfony
The Definitive Guide to Symfony (which we’ll call “the symfony book” from here on out) is an Open Source book written as a companion to the symfony PHP framework. Written by two of the most prominent names in the symfony community, Francois Zaninotto and Fabien Potencier, the symfony book is serves as not only a wealth of information for symfony developers, but also the de facto symfony manual.
The symfony book is published in print by Apress, and licensed under the GNU Free Documentation License. The book can be freely read online at http://www.symfony-project.com/book/1_0/.
Now lets get to the good stuff.
After a short introduction and description of basic terms (PHP5, OOP, ORM, PEAR, YAML, RAD, etc) the symfony book dives straight into symfony’s backend code. Using the symfony architecture as an example, this chapter is a great way to learn about and refresh your knowledge of the MVC design pattern. We are provided with the regular MVC flow charts, as well as examples of “flat” PHP code which is then compared to symfony’s layered approach. The third chapter focuses on getting symfony installed on your webserver - since symfony comes with a fully functional sandbox the installation is fairly painless. Once we have a functioning symfony installation we can move on to “Page Basics” and “Configuring Symfony” in the fourth and fifth chapters.
The sixth through ninth chapters are the “Core Architecture” section of the book. In these chapters the Model, View and Controller layers are analysed in detail. Through each chapter we learn more about YAML and symfony configuration. The model chapter describes Creole and Propel (the database backend) for the first time. More details about both YAML and Propel are in the final section of the book.
Chapter nine starts the “Special Features” section with a description of the routing system which is provided with symfony and is followed by the chapter on forms and validation. Chapter 11 describes the symfony AJAX integration which uses both simple javascript as well as usage of the bundled Prototype library. The Special Features section closes with chapters on caching and localization.
Part four “Development Tools” begins with a chapter on Generators. This chapter promises to the be most read (and most frequently referred to) chapter in the book, as it describes in detail the configuration and commands needed to automatically build the scaffolding for your application. Using the symfony generators is RAD at its finest and mastering this chapter is one of the crucial parts of using symfony to its fullest.
The Unit and Functional Testing and Application Management Tools chapters cover the essential unseen components in every project, unit testing, logging, debugging, and benchmarking. Other deployment tools provided with symfony, as well as symfony deployment best practices are also covered. The fourth part of the book ends with an extensive look at Extending Symfony.
Up until now, the symfony book has covered all the aspects of creating and deploying a site using symfony. To effectively maintain a production quality symfony site, you’re going to have to read up on “Becoming a Symfony Expert” which is the final section of the book.
Becoming a Symfony Expert starts with a chapter on Performance. Due to the architecture of symfony, and frameworks in general, there is a substantial overhead which is caused by all the various components. This section focuses on teaching you how to minimize the overhead by speeding up code, caching and turning off unneeded functionality. The book ends with a chapter on YAML and “Mastering Symfony’s configuration files.
In general I found this book very informative both on a symfony and PHP level. Like always, I had a few minor issues - due to the fact that the chapters are grouped in general functionality rather than in traditional development phases reading from cover to cover may be a bit awkward. Having said that, each chapter builds well on the preceding chapters, and the result is a very well rounded description of not just symfony, but also the surrounding technologies. The intended “user level” is stated as “Beginner-Intermediate” this is in reference to experience with symfony, not experience with PHP. To fully appreciate symfony, and MVC/ORM/RAD concepts in general, you will need to have at least some experience in developing and deploying web based applications.
To conclude, this book was a great read and I am looking forward to playing with symfony in upcoming projects.
This review was contributed by Aaron Wormus, the technical lead and managing director of HedgeCoWebsites, based in West Palm Beach, FL.




