Review: Yii 1.1 Application Development Cookbook

Well, It’s been a complete month since I started reading the Yii 1.1 Application Development Cookbook, written by Alexandar Makarov. I wrote a preview of the book a month back, which can be found here (Book Preview: Yii Application Development Cookbook).

There are 13 chapters in the book, covering majority of the important features and aspects of Yii Framework, including topics like URL Routes, AJAX and jQuery, Database & Active Record, Forms, Modules, Components, Widgets, and also some Testing, Performance, and Security related examples, which are ready-to-use in PHP-based web-applications.

The cookbook is all about examples, demonstrating various features of Yii Framework. As I mentioned in my previous Preview post, this book will benefit those developers who have a basic knowledge about Yii, and have a limited amount of time to work on their projects, as it’ll provide you with a large number of quick solutions which are very generic and practical. And the best thing is, the examples can be applied to your projects in a matter of seconds. You may download the source-code of all the examples found in the book from the publisher’s website on buying the book.

The Yii Framework official documentation is generally not considered to be very good, due to lack of many such examples. Yii is relatively new web-application framework in the PHP scripting line, and due to this reason, the documentation is still going through a lot of changes. This book completes it by providing a large variety of examples on almost every feature in Yii.

Although it’s a good read, I won’t recommend it to the beginners who are starting to learn Yii or PHP. As I just mentioned, the book emphasize on real-time examples, not the basic theory part. However, I would consider the combination of Yii Definitive Guide, and this coobook to be perfect for every aspiring Yii developer. The definitive guide will walk you through the basics of Yii, explaining most of it’s features and provide some basic examples. And the cookbook will sharpen your knowledge by providing more straight-forward examples, which are easy to understand and apply in our day-to-day work.

Another thing I like about this book is that, it provide references to every topic after examples, for further reading, and understanding the concept completely.

I also learnt some cool new Yii tricks, which I find very useful, and rarely available on the Internet, hence making it a worthwhile experience for me. :)

I rate this book 4 on a scale of 5, and I highly recommend that every Yii developer should buy it, and read. It’ll come very handy in tight situations when it’s difficult to find quick solutions to your web-development related queries. You can buy an electronic version of the book from the Packt publisher’s website.

Book Preview: Yii Application Development Cookbook

It’s been a long time since I’ve written something here due to my stringent schedule. Fresh Start!

Earlier, I wrote about a web-application project which I was working on, based on a PHP-based framework called “Yii”. That was my first project developed on a core PHP framework, apart from WordPress and Joomla who have already established themselves as high-end Content Management Systems (CMS). Since then, it’s been a very intriguing experience for me.

The moment I installed Yii Framework and started working on it, I was so very amazed about how easy and time-saving it was to develop a web-application with Yii as it’s beating heart. Yii provided all such features I desired in my application, some of which are:

  1. High-performance with less loading time.
  2. Easy jQuery & AJAX integration for Form validation, updating page elements dynamically without refreshing, etc.
  3. Customized Themes, and Modules/Widgets integration.
  4. User-friendly interface, and debugging system.

For more details on the platform & it’s features from a practical point of view, please refer to my earlier blog post “Yii Framework (PHP) Explained: A Practical Approach”.

Yii Application Development CookbookRecently, I received a review copy of the Yii 1.1 Application Development Cookbook by Alexander Makarov from it’s publishers, Packt. The best thing about the book is that it already have some ready-to-use solutions to general day-to-day problems, people usually face while developing their projects. It’s not just for the beginners who are willing to learn Yii, but also for the regular Yii developers as it’ll prove out to be a very handy guide.

I’ll be going through the entire book in the next few days, and will post a review here. For more details, Table of Contents and Sample Chapter, please refer to the official webpage of the book on PacktPub.com.

There haven’t been too many books published on Yii Framework in the past. Being a relatively new framework, Yii is gaining popularity at a rapid rate, and currently stands at a challenging position with other PHP Frameworks like Zend, CodeIgnitor, CakePHP, Kohana, Symfony, etc. for the top spot.

Yii is truly a very fascinating platform for PHP developers, and I highly recommend it’s usage for the development of a wide-variety of websites and web-applications.

Yii Framework (PHP) Explained – A Practical Approach

Hey Folks, unfortunately, I don’t get much time to write articles these days, as I’m working on a very critical project which requires more attention. The project is actually a website which I’m developing to handle Online Programming Contests. Its not a full-fledged Online Judge system, but rather much like Google Code Jam in the way it works. Its still in the development stage, but I’m planning to extend it into a full-fledged system, after the Online C/C++ Programming contest, which I’m managing, finishes on April 1, 2011. So, I thought why not discuss a bit about it, and tools I’m using to develop it.

I’m familiar with PHP/MySQL only, as far as the development part of the data-driven dynamic websites are concerned. So, before I started working on this new project, I was looking for a perfect PHP framework to start with, as I was low on time, and had to develop it real quick. In case if you’re confused about the term Framework, it is basically a structure, a backbone on which the websites are developed. It provides certain set of inbuilt files, rules, methods, classes etc. which we can easily use in our website. Using a framework makes it a lot easier to develop websites, and saves a lot of development time coding each and every part of the website starting from scratch.

I usually develop websites on WordPress, and Joomla but that’s about normal websites. This project is much rather a complete Application. And if you’re developing a Application, you have to keep few things in mind – High Performance with Less Overall Size (including Database, Files etc.). I could have easily opted for Joomla or WordPress, but I was sure that I won’t be using much of their core functions and files, and that would add a tremendous amount of extra bulk to my website (Large Overall Size, with Low Performance). So, I started researching about other PHP basic frameworks, and my research came to an end with two frameworks as the end result – CodeIgniter, and Yii. Though there are many other frameworks like Zend, CakePHP, Symfony, Kohana etc. but I was also looking for one which is Powerful, has a Short Learning Curve, and a very Thorough & Good Documentation available . That’s why I stick to both CodeIgniter and Yii at first.

I tried installing both on my local machine with LAMP installed, with Yii first. It just took me 2 steps to be able log into my new project from Web-browser i.e. 2 step installation before you can start working on an application. First, I extracted the files to /var/www, and Second, I used a command line tool provided with Yii (Yiic) to install the basic structure of my project. That’s it, and I was very impressed. Then, I tried installing CodeIgniter. I extracted the files, and tried to open it from my Web-browser but it showed up 503 error, even though everything was perfect – Apache, File Permissions etc. And I found a few more posts on the Internet related to the same error on localhost. So, I had no other option but to start working on Yii, as I didn’t have much time to research about the CodeIgniter problem, and Yii looked quite impressive at first. I don’t criticize CodeIgniter in any way, and there are a lot of developers happily using it, but Yii diverted my attention away from it. If you want a Detailed Comparison between CodeIgniter and Yii, refer to this article.

I’m using Yii Framework for quite a few days now, and things which I found impressive about Yii framework are:

  1. Easy 2-step Installation.
  2. Clean and thorough Tutorials and Documentation with large Community base. In fact, if you’re willing to start using Yii, follow this tutorial by Larry Ulman – The best I found so far, on the Internet, from a beginner’s perspective.
  3. Uses MVC (Model-View-Controller) Framework structure, which is very popular these days among Web applications. I’ll be explaining MVC in a separate post later on.
  4. It generates Model, View, and Controller files for your application project by just accessing the database. So, after the installation, the next step you need to do is to create a Database schema for your application, and use the Gii tool provided with Yii Framework files, to generate those files from the Database schema –  The part I liked most about Yii. Thus, most of the basic frame of your application is generated by Yii within minutes, without requiring your assistance in writing a single bit of PHP code. Other things it generate by default, are a Captcha enabled Contact form, and a Simple Login system, which can be customized as per your requirements.
  5. Yii also provides built-in jQuery support, and supports AJAX for many operations such as Form validation, File Upload, dynamically updating page portion, etc.
  6. Supports extensions to enhance the functionality of your application. There are increasingly number of extensions available on the Yii Framework’s website.