tags:

views:

248

answers:

12

Hi,

I have been a PHP developer for almost six years now, and during that time, I've written everything by hand. Literally everything.

I'm now interested in learning more about MVC, and, as such, am interested in picking up a framework to play with.

Before I go any further, let me just say that I know this question is subjective, and that is why I have marked it as such. I am not trying to start a fight, I am merely trying to find the one the most people think best fits the following specifications:

  • Takes advantage of PHP 5's new OOP features
  • Lightweight – doesn't require that I do everything its way or not at all, but is still very powerful
  • Good documentation

I was leaning towards CodeIgniter for reasons #2 and #3, but the documentation explicitly states that it has not been updated to use PHP 5's new features.

What do people recommend given my three wishes?

Thanks in advance.

+1  A: 

Check out CI (CodeIgniter). You'll love it.

antonvan
Great if your for some reason stuck on PHP4.
alex
+1  A: 

I really like CodeIgniter. Don't see why you have to use specific PHP5 features, most of the OOP additions in PHP5 aren't really essential.

DisgruntledGoat
They are not essential, but they make life easier IMO.
alex
+6  A: 

Kohana is a rewrite of CodeIgniter in PHP5, with some architectural differences. It's not as fast as CodeIgniter, though.

Brock Batsell
Thanks. Much appreciated.
benjy
It is PHP5 only - this is an advantage in my opinion.
alex
+3  A: 

Kohana 2 sounds like a good bet for your requirements. Kohana 3 is arguably a better framework, but it's still not that mature (and is rather lacking in documentation). Kohana 2 is still being actively developed.

As for Kohana vs. CI, Kohana started off as a fork of CI, but has since been completely rewritten (twice as of version 3) with greatly improved architecture and use of PHP5 features, too.

Will Vousden
+4  A: 

I think ZF comes the closest to matching your 3 criteria. It's not "lightweight" in terms of class footprint, but it absolutely does not lock you in to doing things "their way".

Peter Bailey
This is a good point. One of Zend's strengths is that you're free to use only the components you need and leave the rest.
Will Vousden
+2  A: 

I am a huge fan of CakePHP. I find that if you use their naming conventions you can get your application up and running in no time.

It has a great community and an IRC chat room for help.

It doesn't however take full advantage of PHP 5

+1  A: 

What features of php5 in CodeIgniter missing? It checks for php version, and loads a file for php4 or php5. Personally, I like when frameworks don't dictate what version of PHP I need. I do work in php4 and php5, and so its nice not to have some finicky framework to use. There are no benefits to be php5 only vs php4+php5. None. It is a liability. And when php5.3, php6 start becoming more widespread, I bet that CodeIgniter will be more resilient than Kohana.

anarkhos
php 4 doesn't support autoloading, so CodeIgniter uses a loader class which has some serious disadvantages. The most obvious is the longer unnatural syntax. Also, the loader creates singletons which are not always desirable.
rick
+1  A: 

I'm a big fan of codeigniter. The community is their biggest strength in my opinion. The learning curve is pretty easy, too. In fact, it might be too easy, allowing you to write some pretty bad code in hindsight.

Jason Shultz
+1  A: 

Zend its definilly what every php programmer should aim at. In counterpart you wont have any autocode generation like some other frameworks, but.. ¿who like thoses?

A: 

Try Zend Framework, you can use any fonctionnality at will, it is very flexible. But watch out, this is also a weakness : it has happened to me to re-develop something that already exist, because I didn't read the documentation.

It is not lightweight though.

Matthieu
A: 

Try out symfony, it may get you closer to your goal of lightweight than any of the other suggestions and is in my mind the first PHP framework to actually do something new with PHP. It doesn't feel like a standard MVC framework, it's super light, and it's actually pretty fun to use.

You can see the getting started guide here: getting started.

Hope that helps!

Chuck Vose
+1  A: 

I think people are missing the point on CodeIgniter's php 4 & 5 support.

It's built to handle both, but it has a slightly different core base for both (c.f. system/codeigniter folder).

After that if you know your host runs PHP 5 then build all your application's controller and library using any php 5 features.

CI rocks!

Ben