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
Laravel for sure, it is very readable, it's one of the fastest. I have to say more importantly, it is very enjoyable to code in. Check it out: Laravel.com
I am using it for my current project, I have only experienced it for about a month I think :)
I am using it for my current project, I have only experienced it for about a month I think :)
I've always used CI. I know a lot of people tend to look down on it, but it's easy to use and suited my needs. Can't you install both Yii and CI and decide which one you like best?
I personally love CI. It's easy to use and very flexible.
I have used Cake PHP and Yii too. But they are not that modular and flexible when it comes to CI.
I have used Cake PHP and Yii too. But they are not that modular and flexible when it comes to CI.
The biggest problem I have with CI as a specific application framework is the insistance of being extremely backwards compatible (PHP 4 support was dropped less than a year ago, and they only very recently stopped supporting 5.1). I understand why this makes sense for Ellis Labs (the developers of it) since Expression Engine is designed to be deployed by clients. If you're picking a framework to use, pick one that allows you to take advantage of all the improvements made to the language (PHP 5.3/5.4 bring a huge number of improvements over even 5.2). I also have a number of fundamental disagreements with how CI is built - no proper autoloading system, a weak routing system (no URL helper/parameter mapping), no request/response objects, odd controller instation and library/model loading (generally fairly disconnected from standard OO design)
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.
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 too am hearing extremely good stuff about Kohana, but I have a lot of people against not fully complete Kohana Documentations.
Also Kohana is said to be quite similar to CI.
I would say Zend Framework not the easiest to learn but very well structured and reliable.
[deleted](1)
I've just migrated to SlimFramework for one of our biggest projects. It is all I could want in a framework: it provides routes, basic structuring, middle ware, views, and leaves the rest up to you. This made it super easy to switch, as I can use my own ORM and was able leave most of the structural logic intact.
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
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
ModX is good if you can write your own PHP without difficulty.
I have a co worker who used Yii, it looks very rails-like and doesn't look like it would be that hard to learn.
Kohana is a very solid framework.
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.
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.