Have a web project that you need done fast and you need it done right? Oh what’s that, you are also a fan of many of the concepts behind Ruby on Rails but want to find a PHP spirited equivalent?
Here are my top five reasons – in no particular order – on why Yii is so stinkin’ awesome!
The demos are easy for you to work from and they provide a great place to observe someone else’s code at work. The also provide a pre-built Yii VMware virtual machine that you can download and jump right into the development mix with.
From the ground up, Yii is built and integrated tightly with the amazing unit testing library PHPUnit. I wasn’t too stoked about Unit testing when I started, but Yii really proved its value to me.
Not only does it make me feel accomplished after writing a great test, but dudes, I sleep so much better at night.
The forums are awesome, I mean really awesome. The folks there are happy to respond to any question you have, as long as you provide your code and a decent description of what your are running up against.
Yii is modular and extending it has always been a core concept. With the healthy way that Yii lazily loads its modules and libraries, the community has really rallied around creating some awesome extensions.
I personally subscribe to the Yii extensions RSS feed just to see what goodies everyone has been making.
Hands down, Yii’s documentation is some of the best I have ever seen coming from a PHP framework. And they are updated all the time. If something changes in the core, guess what, the documentation reflects that instantly.
Not only are the reference API documents amazing, but Yii’s definitive guide gives context to everything that Yii is about. It is a great place to start reading, and then bouncing into their wiki if you need to.
Source Code (Bonus!)
If you look through the source, it is insanely clean and easy to understand. Need to work with the user, utilize the CUser class. Or how about some HTML for creating your views, may want to check out CHtml.
Another awesome thing is that comments are also at the beginning of every method and object. These same comments can be referenced from the website as well. How. Sweet. Is. That?
AR & Scopes (Double Bonus All The Way!)
Active Record and Scopes while not new concepts are very effective when done right. The Yii CActiveRecord class is something of pure beauty. If you use AR’s in Ruby On Rails, you will be right at home here.
The use of scopes is also a must have when trying to limit, well, the scope for your objects. Make sure to check that out as well.