Instant Building Multi-Page Forms with Yii How-to Book Review

book reviews forms

A review of Packt Publishings latest Yii book 'Instant Building Multi-Page Forms with Yii How-to'.

A mini cookbook covering Yii's form creation, validation, file uploading and AJAX functionality.


A mini cookbook introducing Yii's basic to advanced form functions.

Some good recipes which introduce the use of multi-page forms, file uploads, AJAX validation and submission, but as a whole I feel the book is let down by it's length, price and code inconsistencies.

What They Say

  • Learn something new in an Instant! A short, fast, focused guide delivering immediate results
  • Quick, easy-to-follow recipes with immediate results
  • Filled with useful tasks to improve maintainability of web applications
  • Customize your complex and lengthy forms to create easy-to-follow and concise multi-purpose forms

Who This Book Is For

Anyone wanting a pocket reference to Yii form functions.


Although the book consists of 50 pages, the actual content covers 35 pages.

  • Preface
  • Instant Building Multi-Page Forms with Yii How-to
  • Getting started with Yii (Simple)
  • Connecting to the database (Simple)
  • Using the Gii tool (Simple)
  • Creating basic forms (Simple)
  • Building multipage forms (Intermediate)
  • Validating forms (Intermediate)
  • AJAX forms (Advanced)
  • Uploading files (Advanced)
  • Using multiple models (Intermediate)
  • Customizing looks (Advanced)


I thought this book would be a doddle to get through due to it's size and the simple nature of some of the recipes.

I think just about every book on Yii starts with how to install and create an app instance. This is perhaps a necessity when the book is aimed at all levels of readers, but it also means that the first 8 pages aren't needed for anyone who has used Yii to connect to a database and generate a model and CRUD leaving 27 pages.

If you end up with a copy of this book then do not forget to download the accompanying code from the Packt website, I cannot emphasize this enough. At first I thought there was none available as it didn't show up in the list under 'Yii' or 'Instant', my stupidity really as it's available under the title of the book 'Instant Building Multi-Page Forms with Yii How-to' :)

The reason I had to check the code downloads was because I ran into trouble after hitting the first intermediate recipe 'Building multi-page forms'. There's nothing actually wrong with the code in the book, it's just that a lot of it is missing and there is no note to say where the rest of it is, it seems to be assumed that you can finish it off and is replaced with ..... This set me back quite a while as I searched for why I was getting error messages. Once I saw the rest of the code, I was referring to the download for each section of the book just to see if anything was left out (which it wasn't really).
After getting the correct code, this was actually the most interesting part of the book and the first time I have seen this subject covered.

The next section on validation seems to have been written without actually checking the code (which is the same in the book and the samplecode). Yii doesn't have a validation method called 'numeric' it is 'numerical' so will result in an error even when copying and pasting the sample code. 

Although the book is presented as a cookbook, each recipe uses one of the forms created in the first couple of sections. As I was following the book from start to finish, this led me into another couple of problems.

On the form uploads section, I was using my AJAX form created in the previous recipe. Unfortunately this meant that the file didn't end up where it should have done. As I knew better this time, I checked the download code and saw that AJAX had been taken out, and after that the file was uploaded.
I felt this whole section was lacking in information. We have been shown how to use AJAX to submit a form, but not a form with a file upload. The way the code is written, the file is also saved with no extension and apart from validation and how to get the file properties, there is no mention of saving the file with the correct extension. This is probably overly harsh as this section is marked as advanced and it's pretty easy to add the correct extension when you have been told how to get it from the original. It just seems strange that the example isn't expanded to correct this. There was also differences in the code you get given, the code in the explanation and the code in the download when it comes to the filename and path.

Unfortunately I gave up on the last chapter as the first lines of code gave e errors and this section is missing from the code downloads.


I was hoping that this would be a good go-to book for the next time I need to do anything with front-end forms (The book covers all forms within Yii, but for my projects the standard forms are fine for the backend admin). Now I have got through it, I may actually call back on it in the future, but unfortunately, as a learning aid I think it fell short as I spent more time looking at errors that taking in what I was actually doing, I was just glad when things worked and moved on to the next part.

For such a short book I'm not sure the price is justified. Not to play down the efforts of the author or the whole process that the book goes through before it gets to you, but when you compare this to the Yii Application Development Cookbook which consists of 408 pages and over 90 recipes for double the price (£14.44 for the ebook compared to £6.79 for 35 pages and 10 recipes) it doesn't seem to add up.

I'm afraid I wouldn't be able to recommend this to anyone unless they specifically wanted it for the multiple page form recipe.

Overall I would give it 2.5/5

Blog Comments powered by Disqus.