Book review: Yii 1.1 Application Development Cookbook, by Packt Publishing

Yii 1.1 Application Development Cookbook

As I said in my preview, Packt Publishing sent me the e-book version of its new book, "Yii 1.1 Application Development Cookbook" for a review. It took me a while to read the whole book, but it's now time for the full review.

The book is about the Yii PHP framework and is written by Alexander Makarov, a core Yii developer. The book is a cookbook, which is a book full of recipes that utilize the power of the framework. It's not a book that follows the approach taken by other books, where an application is built step by step, thus showing the features of the framework each chapter by chapter. The book follows an approach that presents a specific problem in an application and shows the solution to this problem. Below I will present an overview of each chapter.

In chapter 1, the author presents some of the "under the hood" features of Yii, like getters, setters, events, import and autoloading, exceptions, components, widgets, Yii core collections and working with the Yii request object. Although a first chapter, it does introduce some very good Yii tips.

In chapter 2, the author writes about the router, controller and view, the basic principles behind the Yii framework, since it's a Model View Controller based framework. In this chapter, you'll learn about how to configure and write url rules, how to use the base controller class, how to use the basic view class (partial views, clips, decorators, etc.), how to use multiple layouts and paginate and sort the data displayed.

AJAX and jQuery are the main subjects of chapter 3. You will learn how to load content with AJAX, manage assets, include resources in a page and work with JSON content.

Working with forms is what the chapter 4 is about. You will read about validators, how to add and customize CAPTCHA in a form and how to create custom input widgets.

Chapter 5 is all about tests. The author describes how to set up a testing environment, how to write and run tests, how to use fixtures and test your application.

In chapter 6, the author writes about interacting with databases, using the Active Record object to retrieve data from databases and presents some tricks about the Model object.

Chapter 7 is about the Zii components, a stack of utility classes integrated in the framework. A few examples of these components are data providers, grids, lists, etc.

In chapter 8, the author writes about ways to extend the Yii framework. He writes about how to create components, widgets, reusable controller actions, filters, modules and other objects.

Chapter 9 is about errors, error handling, debugging and logging. You will discover ways to use different log routes and analyze the stack trace of an error.

Chapter 10 is all about security. Security implemented through the use of controller filters, the use of CHtml and CHtmlPurifier to prevent XSS attacks, ways to prevent SQL attacks, use of the RBAC model, etc.

If you need to further enhance the application's performance, then chapter 11 describes ways how to achieve this.

Chapter 12 is about integrating third party code (outside Yii's core) with Yii. Provides examples on using the Zend, Kohana frameworks and code from PEAR with Yii.

The last chapter, 13, is about deployment. How to change directories, how to move the application out of the web root, how to move configuration directives in separate files.

Overall, this is one of the best Packt Publishing books I've read, maybe the best. If you are serious about developing with Yii, it contains many tips and solutions to commonly faced problems. The fact that it's written by a core Yii developer is surely a huge plus, since you will be able to learn stuff "first hand".

Don't miss this book if you want to be a competent Yii developer.

I would like to thank Packt Publishing for its offer to send me the electronic version of the book.

διάφορα / miscellaneous: 
υπολογιστές / computers: 
Χρήσιμο / Useful: 
Average: 3.4 (13 votes)
Ψηφίστε για την ποιότητα του άρθρου / Vote for the article's quality