7 ms·
Ask HN: Best PHP Framework for Web Development
I have been working with PHP for almost a year now. And I m quite familiar with the language.
So I was thinking to start using a framework for my next project.
I m actually really confused as there are so many good frameworks with such good features with docs & extensions.
I m really actually looking for a decent framework which is really easy to use.
I ve considered Yii, Zend, CakePHP.
Would like to know about your experiences about these frameworks!
- debacle 14y agoI would start with Silex. It's a very small framework, pretty well written, and very easy to pick up: http://silex.sensiolabs.org/ http://silex.sensiolabs.org/ It's also supported by Sensio, who has a good track record. I'd pick it over Symfony because it's more lightweight and over Kohana or CI because it has better documentation. Cake will lead you down a dark path, and ZF is bloated and unwieldy. Yii seems nice, but I think they lack direction.
- AjJi 14y ago>Cake will lead you down a dark path Why is that?
- kaolinite 14y agoZend Framework is the traditional 'enterprise' framework, you won't go wrong with it, though there are quite possibly better alternatives. That's what we use where I work. I've heard very good things about Kohana but don't have much experience with it. Just try and pick something with a good set of documentation and a decent community.
- vanwilder77 14y agoSure !! And well thats the confusing thing for me. Every framework comes with some pros and cons and it is really tricky to decide which framework to go with.
- kaolinite 14y agoI think in that case Zend Framework might be a good choice. It may not be the sexiest framework but it's developed and supported by Zend, the company behind PHP. It isn't going to fade away any time soon and there's tonnes of support and advice around.
- jaz 14y agoAnother nice thing is that Zend Studio is pretty tightly integrated with Zend Framework. It's particularly nice when you're dealing with large ZF projects.
- polyfractal 14y agoI don't think it matters too much when starting out. For a beginner (in the framework, not coding in general), they are all relatively equivalent. Pick a framework and begin using it. After a few projects, you'll quickly learn what you like and don't like about the framework. I'm a fan of CodeIgniter, but mostly because it is what I'm familiar with. It has some irritations and kludgy things required, but they don't annoy me enough to warrant a change (yet).
- gexla 14y agoDepends on what you need it for. Different frameworks handle different situations better than others. If you haven't had the need for a framework yet, then perhaps you shouldn't bother too much with looking. I generally start reaching for tools when I feel that what I'm currently using could be improved on. Most PHP frameworks are just some sort of approach to the Model-View-Controller pattern and a collection of libraries for helping with typical things that you might deal with in web development. You can mix and match libraries from different frameworks and they all have their different methods of usage. I would probably go with something simple, lightweight and well documented. Some frameworks have so many steps and focus stealing side shows that it's a project just to get started with the things. Maybe take a look at Fatfree (http://bcosca.github.com/fatfree/ http://bcosca.github.com/fatfree/) and then expand into other frameworks from there if it doesn't do what you need it to.
- LarryMade 14y agoDepending on what you do your mileage may vary. What I was doing didn't fit in with what the then current frameworks offered - so I made my own... and that's how all those frameworks got their start as well. My suggestion is to look at the various framework features and see which one best suits your needs.
- mootothemax 14y agoI favour Kohana (http://kohanaframework.org/ http://kohanaframework.org/). Very quick and easy to get the core of your app built. Only (and potentially major) downside is that the documentation can be tricky to wade through. I'd run away from CakePHP. Caveat: last version I worked with was 1.3. The weird way it uses arrays in its ORM to kinda-sorta-but-not-quite work on the database always hurts my head. In fact, the whole way of going about things in CakePHP hurts my head.
- gyardley 14y agoAgreed. Kohana's tutorials are pretty bad, but the API browser is solid and the code of the framework itself is very readable. As a beginner, having to dig under the hood of Kohana to fully understand it initially turned me off, but I came away with a much better understanding of how MVC frameworks work.
- trevelyan 14y agoI've never had any problem with CakePHP and am curious what you mean.
- MattBearman 14y agoFor starting out I'd definitely recommend CodeIgniter (http://codeigniter.com http://codeigniter.com) simply because the documentation is second to none. Since learning CodeIgniter I've tried CakePHP and Zend, and found CodeIgniter is easier to use, and just as powerful, so I've stuck with it. In fact the BugMuncher (http://bugmuncher.com http://bugmuncher.com) back end & API is built on my custom version of CodeIgniter Also check out the datamapper ORM plugin (http://datamapper.wanwizard.eu/ http://datamapper.wanwizard.eu/) if you want Rails-like Active Record goodness.
- gchucky 14y agoUntil recently at work we've use Symfony1. It's going to end of life at the end of this year, and I think we're going to shy away from Symfony2 for now. It's a bit of a mess, I think, and it seems like they're going to correct a bunch of things in 2.1, but that won't be out for a few months. We'll probably reevaluate after that. Our other goto framework is Cake. People do have a lot of good/bad things to say about Cake, but I rather like Cake 2. It's a little more mature now, and I don't really think it's as hugely complex as Symfony. I use Zend on my own, but I'm becoming disillusioned with it. It seems to be overengineered and, after using Doctrine for as long as I have, its modeling leaves a lot to be desired. Recently I've been researching FuelPHP (http://fuelphp.com/ http://fuelphp.com/) and it seems to have potential. It's a little better designed than CodeIgniter and its ORM seems interesting. Hope that helps.
- dirkdeman 14y agoI tried a couple of them and sticked with CodeIgniter. Sure it has some quirks, but it's powerful, easy to grasp, not bloated (hello, Zend!) and more than capable to satisfy your web dev needs. Plus it has a great community and lots of tutorials. But really, my advice is to spend a day or two trying several of them out. Create a simple project with each of them (the ubiquitous blog for exampe) and see what works for you. Good luck!
- rmATinnovafy 14y agoI've been working with Slim and it is pretty good.
- Kmanicka 14y agothis blog post seems to cover this topic well http://davidjconnelly.wordpress.com/2011/07/03/the-best-php-framework-of-2011/ http://davidjconnelly.wordpress.com/2011/07/03/the-best-php-...
- twog 14y agoIf you're looking for a modern framework, I would recommend http://fuelphp.com http://fuelphp.com. It doesnt have the size of community that a codeigniter or cakephp will have, but it leverages a lot of the great MVC framework features that Rails launches with.
- cleberwsantos 14y agoI recommend Laravel. Simple, clean and powerful. http://www.laravel.com http://www.laravel.com
- Canada 14y agoYii
- bonsai 14y agoHave you considered Symfony 2 http://symfony.com/ http://symfony.com/?
- petervandijck 14y agohttp://laravel.com/ http://laravel.com/ looks very promising