Ask HN : Which PHP Framework to prefer?
I haven't got any previous experience in PHP frameworks, and at the moment due to some project I am being forced to use one.
I has always been between Yii and CodeIgniter.
Please help me out which one to prefer, and is easier to learn.
12 comments
[ 1.8 ms ] story [ 31.5 ms ] threadThere are issues however with performance, I've found. A brand new project loads in ~40ms, and that's before you've done any work at all. Add in some forms with Zend_Form and other bits of functionality and you can start to see page load jump over 500ms (though admittedly this is in part due to poor base code written by the company). Zend Framework 2 however is no better - performance is far far worse than Zend Framework 1.* currently. I have also seen some very bad reviews of ZF2, comparing it to Java applications in verbosity and complexity.
I can't recommend any other framework as I don't code in PHP at home, I use Django for personal projects, however I can say that I've heard very good things about Kohana.
The slim framework docs are perfect, the code is clear and the forums are great. I especially like that it doesn't force you to do everything in one predefined way, making the learning curve nice and low
If you want a full featured framework, Symfony2 is a good everything including the kitchen sink although it's a bit more Java-esque (which make sense since much of PHP's OO design is based on Java). http://symfony.com/
For something lighter weight, Silex is based on the Symfony2 components, so it's super easy to pull in more components as you need them. http://silex.sensiolabs.org/
Even if you're not using Symfony2 it's really modular and easy to integrate with other frameworks - we're running CI as our base framework due to legacy reasons, but all of our new work leans heavily on Symfony2 components.
I have used Cake PHP and Yii too. But they are not that modular and flexible when it comes to CI.
The best parts about it are that the source is very readable and it's extremely easy to override the default behavior of many modules. I would strongly recommend doing this as much as you need to because Kohana's defaults may not make sense for your usecase. The biggest downside is that v3 is very different from v2 and a lot of the documentation and help still assumes v2 (this is why easy to read source code is important.
I am using it for my current project, I have only experienced it for about a month I think :)