At work, I was recently tasked with choosing a PHP framework to use for the next version of our main site. It was a bit daunting because there are so many different ones. If you’re using Ruby for web development, you’re probably using Rails, but if you’re using PHP, there’s a good chance you made up your own homegrown framework. That’s what Rasmus Lerdorf, the creator of PHP, encourages developers to do. For better and worse, it’s part of the culture of PHP, so there is no standard framework.
I looked at Yii, Symfony, CodeIgniter, Laravel, SilverStripe, CakePHP, Zend, and Kohana. Almost any of them probably would have been fine. I decided to go with Yii based on the features below. You can compare Yii to other frameworks at vsChart.com.
- Popularity is high and ascendant
- Good official documentation written by someone with a command of English (most important consideration)
- Active development
- Active community
- Automatic code generation with Gii (as a newbie, this is my favorite feature)
- Compatible with the Composer dependency manager (PSR-0 compliant)
- High performance due to lazy loading
- Supports data, fragment and page caching
- Includes security measures to help prevent various kinds of attacks (SQL injection, cross-site scripting, cross-site request forgery, and cookie tampering)
- Has an object-relational mapper (Yii Active Record ORM)
- Supports template syntaxes like Smarty and Twig
- Supports unit and functional testing
- User-friendly URLs