So you want to learn to use Zend Framework, and develop a web app with it. Maybe you’ve been looking at a book to help, too.
This is what Keith Pope’s book Zend Framework 1.8 Web Application Development promises to teach you.
And I think this is the best book for the job. Continue reading to find out why.
The basic premise
From the back cover of the book, it’ll teach you…
- Zend Framework’s architecture
- Designing and implementing an MVC application
- How to avoid common mistakes
- Unit testing with PHPUnit
- Interacting with the database using Zend_Db
- Securing your app with Zend_Auth and Zend_Acl
- Optimizing with caching and other tricks
- Adding adminstrative functionality to your app
This is a lot for one book… But this book has all this and even more.
The contents
Zend Framework 1.8 Web Application Development is filled to the brim with great information on developing applications with the Zend Framework.
For a ZF beginner, it has everything they need to know to get started quickly and to get many common tasks done. After you’re out from the beginner phase, it has information on more ZF components and things like how to extend the built-ins.
The book also often contains helpful hints and tips, warnings on common pitfalls and explanations on topics the reader may not be familiar with, such as design patterns used and even simpler things such as the difference between authentication and authorization.
Almost all if not all of the the parts of ZF that are used most commonly are covered. Bootstrap, configuration, the front controller, the request and response, fancy URL routing, dispatching, controller plugins, MVC controllers, helpers, views, view helpers, layouts, form generation, authentication, authorization, database access, logging, debugging, caching and more.
The list of ZF components this book covers is very long and very thorough. The components it doesn’t cover are mostly more exotic things that you don’t need so often, and which are often more straightforward to use.
Not only does it cover the most useful parts of the framework, it also goes to some depth on how to extend and customize them beyond their standard capabilities. However, for purposes of extending the framework, the book mostly serves as an introduction you can use to help get you started. Perhaps a topic for another book?
Also included is some non-ZF information such as opcode caching, and more general theory on good MVC design practices such as how to best organize your code in controllers and models for best reuse.
The writing style
Since this is a book aimed at people not yet familiar with the Zend Framework, the writing style is very important – it would be no good if it was hard to understand.
However, Keith’s style is very easy to understand and he explains everything in much detail. In fact, I occasionally felt the book could advance a little faster, but that’s probably because I’m already quite intimate with ZF – for someone who doesn’t know ZF so well it should be good.
In some places the book also includes helpful diagrams, such as the ZF dispatch process.
The book follows a logical ordering of topics, starting from setting up Zend Framework and your development environment, continuing with basic topics like configuration an bootstrapping. Most of the book uses a real world style example of an online store as a goal.
Using a real world example is good as it exposes typical problems you may encounter when working on your own applications. The problems are tackled one by one, each articulately explained and processed.
A very good thing about this is that the book sometimes presents different choices, which are then each explained with pros and cons. When one approach is chosen, the reason why it was chosen is explained, so the reader gains useful insight.
Other things to note
While the back mentions unit testing, the book doesn’t go very in-depth to it. It does explain the basic use of PHPUnit, giving some examples, and it also has examples on using Zend_Test to test controllers, but to benefit the most you should already be somewhat familiar with the concept of unit testing. The book’s unit testing chapter mainly serves as a starting point, but it’s useful for familiarizing yourself with how ZF-code is unit tested.
To gain most from the book, you should already be quite familiar with PHP5’s OOP features. While knowing OOP well is not a requirement, it will help much in understanding how the components in Zend Framework work, so it’s not just a good thing for the book itself.
The book doesn’t really have any negatives about it. There are some typos, but nothing major, and the coding conventions are occasionally a bit odd but this is mostly a matter of taste. Maybe the biggest downside is that the code is not entirely printed in the book, but it’s available on Packt’s website so depending on your style it may not matter.
Zend Framework is currently going at 1.10, but the book isn’t outdated at all.
The verdict
In my opinion this is almost a must have book for learning ZF. If you’re already familiar with OOP in PHP and want to take your skills to the next level by learning one of the best and most popular PHP frameworks, this is a book for you. There is nothing you need to know to get started and further that isn’t covered.
If you’re already familiar with some other framework(s), this is a great book for learning the ropes in Zend Framework. You may occasionally find it a bit slow paced as it’s very thorough, but it also works as a sort of reference guide type of book, as it covers a great deal of everyday things you may need to do.
If you are already familiar with Zend Framework, the book may not have much to offer for you. It can serve as a sort of a reference book, but you may find ZF’s own reference manual more useful.
The bottom line is, if you want to learn how to develop applications with the Zend Framework, this book is an excellent place to start.
The book is available in both ebook and dead tree formats in Packt Publishing’s store and probably other places too.