In this post, I’ll review what I believe to be the top five PHP frameworks. These frameworks are in no particular order since they all have benefits and can be handy in different situations. Also, this is a matter of opinion; I urge you to try them out. Even try ones I don’t have listed. Heck, write your own.
I’ll start with Silex since that is what I used for this site. SensioLabs makes this micro-framework, and they put out some excellent packages. They’ve done a great job of making money by certifying developers. I think their primary goal is to write great PHP.
This website is pretty simple; you might call it a “basic b*%$h.” It has a couple of static pages and pulls the blog entries from a database. It handles the routing and uses the twig template engine. Since the templates get compiled, it’s fast. I’m using Doctrine to manage the database queries; which simplifies things.
I’ll recommend Silex for small applications; like this blog.
Since I talked about Silex, a micro-framework, I’ll talk about Slim since it falls in the same category. Slim is great, but after looking at the code, I feel like Silex is stronger, so use caution when deciding. Slim is coming out with 4.0 shortly, and they may be changing some things.
I recently used Slim to develop an API for something I’m currently developing. I won’t go into too much detail because it’s top secret, but it is a RESTful API, using GET, PUT, POST, and DELETE (this always makes me think of the movie “Dodgeball”). It’s also using an SQLite database. The main reason I chose Slim for this project; was because it is small and fast. I was able to include a few other packages along with Slim to help me accomplish everything I need.
Don’t knock it until you try it; I like it for writing APIs.
Okay, some people may wonder why I didn’t lead with Laravel. Laravel is magically delicious and does everything under the sun. Taylor Otwell (and contributors) has made a fantastic framework. It’s massive. It uses some Symfony packages because he knows a good library when he sees it. He is superb at keeping things consistent and provides well-defined names for things.
Laravel will do anything you need. It is great when making full blown web applications. It’s tested out the wazoo. It is one of the easier frameworks to learn. And it’s very popular right now. If you know PHP and haven’t heard it, you may want to get out from underneath that rock and take a look.
If you have a great idea for a web app, then you should try Laravel.
Several frameworks that require Symfony components. I believe that is one of the highest forms of a compliment when other people and the community use your libraries. The Symfony framework certainly works well with the other Symfony components, which may give it an edge. However, those other frameworks chose not to use all of the components and write their own for a reason. I’m a huge fan of Composer and putting different packages together. The nodejs packages have gotten a little out of hand, and I hope PHP doesn’t head in that direction.
If you want to learn a framework and get a certified in it, check out Symfony. Or if you like the name, check it out.
Okay, I know what you’re thinking, but it’s not bad. CraftCMS was written using Yii, and I respect those dudes. It has a lot of features, relatively quick, and fairly secure. Yii has great documentation, which is sometimes hard to find. It can be used to build web apps and anything else you would want to make. In my opinion, it does have a steeper learning curve, but it may be worth it. It isn’t as popular as some of the other frameworks, but it is a contender.
Check out Yii if you want to be different. Little fun fact, it wasn’t created by Yahoo.
Sometimes when using a framework, I feel like I’m not doing anything anymore, all the heavy lifting is written by someone else. It can be a pleasant feeling and a sad feeling as I like to write the behind the scenes code. It helps speed up development time, which makes everyone happy. Ultimately, you should probably do whatever your boss says, but if you’re learning for fun, then do whatever you want!
If you disagree with anything, I don’t care; this is only my opinion. However, feel free to email me, and we can discuss it further. As always, if you have questions, also email me, I’m happy to help.