views:

321

answers:

8

Could someone possibly help me choosing a PHP MVC framework? My requirements are:

  • SIMPLE authentication system (no need for ACL, just isAuthenticated(), isInRole()
  • Resources and RESTful approach
  • Helpers (Html, Ajax and such stuff)
  • It would be nice if it was PHP 5 only

I've tested some frameworks. CakePHP seemed good to me, but it has that PHP 4 crap and I don't like it's auth system.

Probably best to me was Nette, but still, do you know any better option that satisfies all the above conditions? Thanks in advance!

+5  A: 

Symfony would satisfy your needs but some find it difficult to get started with. I had no problems and I like it very much as it does a lot of code generation (less work for you) but is still very customizable.

  • It is RESTful and provides a way to simulate the HTTP methods PUT and DELETE.
  • The permission is also simple, just permissions and groups.
  • It uses PHP5.
  • It provides AJAX and HTML helpers as well as a good (and not too complicated) form framework
Felix Kling
We use Symfony for all our PHP projects. We did a lot of testing with CodeIgniter, Cake and Zend when we were moving from raw php to a framework and Symfony's fantastic documentation and community was one of our biggest deciding factors. With the learning curve in most frameworks documentation + community is extremely important and with Symfony they are second to none.
CuriousCoder
Before Symfony I also used Zend but I got the feeling that Zend is more or less a collection of classes. Now the are going more in Symfony's direction. I didn't find it hard to get into Symfony but I have heard that others claim to find it difficult. As for the versions from 1.2 on, documentation is very good. I especially like that they do test driven development, apply principles like KISS and DRY and not try to reinvent the wheel but also encourage to use other frameworks like Zend.
Felix Kling
A: 

There are 50 PHP frameworks listed on wikipedia. You could start there.

EDIT There are 51 there now. I just added Lithium, the CakePHP v3 breakaway based on PHP 5.3+.

Ewan Todd
+3  A: 

I've used Kohana with great success. It spawns off CodeIgniter but with PHP 5. It's really easy to use and the code itself is really good too.

It has Auth modules and html helpers and some other goodies.

Jonas
+4  A: 

Hm, I like working with Zend Framework, it is PHP 5.3 compatibile, and if you will extend your app in the future it has all the libraries you need.

Dr Casper Black
I'll add another vote for ZF. It's very well documented, unit tested, and has regular release cycles thanks to an active community of contributors and users.
David Caunt
Jay Zeng
You know, Zend is a fine framework, but given the OPs "SIMPLE authentication system (no need for ACL, just isAuthenticated(), isInRole()", I"m not sure Zend is the right approach. The initial learning curve on Zend Framework is pretty steep, you spend most of your time digging through code and trying to figure out how you're supposed to use the various libraries. It's awesome once you're up and running, but I'd have trouble describing it as simple.
Alan Storm
+1  A: 

These days I'm playing with Yii and their blog tutorial.

The other candidate is Agavi with the IBM DeveloperWorks tutorial series.

alexandrul
A: 

the right PHP framework is one that does not use or prescribe MVC. let me quote from Allen Holub's Holub on Patterns.

How Do You Do It Wrong?

[...] You create a Frame class whose job is to collect messages coming in from "control" or "widget" objects in response to user actions. The Frame then sends messages into the object system in response to the user action. Typically, the code takes the following form:

  1. "Pull" some vaue out of a widget using a "get" method.
  2. "Push" that value into a "Business" object using a "set" method.

This architecture is known as Model/View/Controller (MVC)--the widgets comprise the "view," the Frame is the "controller," and the underlying system is the "model."

MVC is okay for implementing little things such as buttons, but it fails miserably as an application-level architecture because MVC requires the controller to know way too much about how the model-level objects are implemented. Too much data is flowing around in the system for the system to be maintainable.

just somebody
As true as that might be, MVC has been the dominant pattern for a certain class of web application for at least half a decade. Part of a developer's job is to keep track of that dataflow (via clean code, tests, and will)
Alan Storm
It is always said to keep as less logic in the controllers as possible. So basically they just fetch objects from a database or handle forms. I don't get whats 'too much' here. At some point in your system there has to be the logic to get objects from databases and to handle forms, there is no way around it. Or I don't get you really ;)
Felix Kling
@Alan Storm: MVC has been around since 1980's. So what? Quoting Holub again: [...] other UI architectures manage to hide encapsulation better than MVC. (Perhaps the real solution is to avoid an MVC-based UI framework altogether. MVC was developed almost 30 years ago, and we've learned a lot since then.)
just somebody
I strongly agree: this MVC axiom really bugged me. I prefer the Django way (the middleware is a great thing) which brings to _real_ modularity.
ntd
A: 

I use CodeIgniter for most of my PHP projects. The good thing about it is that it is indeed the lightest and fastest framework out there, and plus it offers everything you are requesting. Give it a try.

George Violaris
A: 

So, thanks guys for responses. I plan to take a deeper look at Symfony. What I read so far (docs...) looks pretty impressive.

Kohana also looks very good.

Jakub Lédl