Sunday, January 17, 2010

PHP MVC Framework Recommendation

This question comes from Brandon M.

hey brother... I've delayed way too long about getting serious with a framework that follows the MVC pattern... do you have a framework that you'd recommend? PHP is my language of choice, and I've been eyeballing CodeIgniter, but your recommendation would certainly go a long way. Particularly, something that is very SVN friendly (as far as keeping the project intact and deployable to mutliple workstations/servers with minimal hassle)

Anyway, mostly in general just looking for a good recommendation on a php MVC framework?

Thanks brother, hope everything is fantastic with you!

If you're new to MVC, I say something like CodeIgnighter or CakePHP are the best choices. They offer a ton of functionality out of the box and have a pretty elegant implementation of MVC. I'm personally partial to CakePHP because of it's looser licensing and it the workflow seems to be more fluid than CI.

I've since switched over to ZendFramework for most of my projects as it offers much more flexability. Unfortunately, the learning curve for ZF is pretty steep (in the hockey stick range, to put it technically).

Be prepared to spend lots of time in documentation. Frameworks (like any new system) always require some upfront reading. You'll have lots of "WTF" thoughts, but just go with the flow.

Cake's documentation used to be horrendous, but has gotten quite good over the years (I recommend doing the blog tutorial to really see how everything works). CodeIgnighter has some great screencasts on their site (last time I checked anyway, which was a lont time ago). Zend, IMHO, has the best docs around ... though, I don't recommend you jump into ZF unless you've got some serious time you can spend up-front.

Readers: It's your turn.

Am I right? Wrong? Agree? Disagree?

3 comments:

  1. I Agree. I'm also a Zend user. It's the first MVC I've used, and Mike's definitely right, it has a steep learning curve, but If you're comfortable with PHP you can pick it up quick enough. It helped me to get a Zend book and work through some from-the-ground up applications. After you get the basics, you can really start flying with it. Fun Fun!

    ReplyDelete
  2. Kohana is not bad...started as a fork of CodeIgniter. There are some issues w/ the road map, and API discrepancies between releases....but it's still nice to have an alternative to CI w/out all the PHP 4 cruft. Also, I haven't used the Symfony MVC framework yet - but they do have some elegant standalone components, like dependency containers, etc. that might make it worth checking out.

    But yea, overall, Zend is where it's at...if you have the patience.

    ReplyDelete
  3. @Kayla:

    I recently worked on a massive project with Kohana which really pushed it to its limits.

    It's got a pretty simple MVC implementation, which I don't think is as elegant as Cake's ... but it's definitely not bad. Especially if you're coming from the CI community, as you already pointed out.

    If you're doing anything large scale with it, I suggest writing wrappers around the ORM so that you can replace it with a different tool (or none at all, if your app will allow) as that was the single component which consumed most of our memory.

    ReplyDelete