It's a piece of cake to bake a pretty cake / if the way is hazy...
June 27, 2008 10:19 AM   Subscribe

I'm fed up with CakePHP taunting me like a disobedient two year-old. What's a better PHP framework built around model-view-controller?

I started out writing raw, sloppy PHP in a text editor, but discovered I'd be doing myself a favour by giving it some structure. CakePHP was my first choice because of its support base and low code-to-results ratio. I still think it's pretty cool, but it's caused nothing but technical hurdles for me. Instead of spending my time learning cool things, I'm on IRC's #cakephp begging for help identifying why code that should work doesn't. And I don't mean 'should' in the Computer Science 101 'Teeeeeeeeacher! Why doesn't this code woooooooooork?!' sense. I mean, CakePHP has gained sentience and has been making my life miserable. One project, set() stopped working. After trashing that and starting over, it refused to save specific columns to my database, and made up names for columns that didn't exist. More often than not, responses to my questions have been 'Well gee, that's weird.' I have been humiliated by a folder filled with text files, and I'm on the brink of DTMFA.

I want a PHP framework that's like CakePHP but with a better user experience. I'm a programmer and not a content manager, so Joomla!-type apps are not what I'm looking for. I want get my hands dirty with documentation and code. Model-view-controller structure is desirable but not mandatory. Personal experiences with your framework of choice highly welcome.

Sorry for the half-rant-half-question, but I truly am feeling what can only be described as the PHP equivalent of trying to feed broccoli to a surly, alcoholic toddler.
posted by spamguy to Computers & Internet (12 answers total) 4 users marked this as a favorite
I use Zend Framework ... you may also try Symfony. The former is newer than the latter and uses more of the advanced php5 stuff. The reason you're hitting problems is that Cake is struggling to maintain backwards compatibility whereas ZF and sF have given up on php4 entirely.
posted by SpecialK at 10:40 AM on June 27, 2008

Seconding symfony... I have used it on several projects now and I am pleased with it. When I run into problems, the folks on the IRC channel help me.
posted by ydnagaj at 10:52 AM on June 27, 2008

Zend Framework is nice, but be aware there's no "M" to speak of. But a note on that....

I have a strong suspicion that w/ regards to "M" in the php world, you're not going to find *anything* that doesn't yield WTF moments. PHP developers have just discovered MVC and Fowler and the like and they appear to me to still be in the optimism phase of fighting the Vietnam of software development. In other places (Ruby and Java and WebObjects etc etc) devs and projects have had time to either really come to grips with the problem, or to scale back to more modest goals. PHP ORMs can learn from these experiences, but I'm not convinced they have yet, and even with PHP 5's good features, it's still a less apt language than some. So I'm not bullish on ORM-focused Models in PHP at the moment. Tread carefully there.

Nevertheless, I'm checking out Doctrine right now, and it might well serve to do some of that lifting in concert with Zend.

Times are bad. Children no longer obey their parents, and everyone is writing a
PHP MVC framework. :)
posted by weston at 11:00 AM on June 27, 2008

Symfony is about to crush my soul. It may be that we made the choice to use a newer version of Propel with it, but it really is hard for me to wrap my head around where things are failing when they fail. Maybe I should join that IRC channel before I just up and quit my job over this torment.

It may also be that I'm not cut out for the object oriented MVC framework world.
posted by advicepig at 11:30 AM on June 27, 2008

I have been using Code Igniter for some time now and really enjoy it.
posted by SirStan at 11:50 AM on June 27, 2008

Seconding Code Igniter. I've used it extensively for the past year or so on small 8 hours apps to a gargantuan project I've been working for a year. Read the user guide to start off, the online docs are really helpful. There's a lot of nice little helpers and libraries that get rid of annoying day to day programming.
posted by ChefQuix at 11:55 AM on June 27, 2008

Qcodo! We use it and love it.
posted by sachinag at 11:56 AM on June 27, 2008

Seconding Qcodo, though it's been kinda stagnant and has branched into Zcodo.

What's great about Zcodo is all of the widgets they provide, and how easy they are to extend.
posted by tomierna at 2:29 PM on June 27, 2008

Another vote for Code Igniter. However, I've found it easier to create my own Models instead of extending their Model class.
posted by null terminated at 3:30 PM on June 27, 2008

All the web frameworks I've tried promise to save me tons of time by writing the db mapping and automating the UI generation. They generally work as advertised, but they only take you 80% of the way. Getting the final polish, to make things sing the way you want is super-frustrating. I end up having to pass crazy-ass parameters into the form building methods, which always takes longer than simply coding the HTML by hand. The database mapping and HTML generation can be tedious, but I find that a library of code snippits from past applications (a form with radio buttons, image upload form, etc.) gives me the control I want and saves some typing. I use Smarty for templating and have a simple generic Application class that does things like load a config file, gets parameters connect to the DB, etc. If the frameworks are getting in the way of you getting stuff done, don't be afraid to dump them.

You didn't say what kind of apps you're writing, but if you're writing something with dozens of unique data input screens, like some HR/payroll monster, then yeah you'll want to stick with a framework.
posted by kamelhoecker at 8:38 PM on June 27, 2008

I've dabbled in Symfony, Zend Framework and Cake and I decided to go with Cake in the end. I've found the 1.2 version to be quite a lot better than the 1.1 version, if that's any help.

As for the others, most of the reviews or summaries have rated Symfony pretty well, so that's probably where I'd look next.
posted by sycophant at 3:19 AM on June 28, 2008

Response by poster: Update: Thanks for all the suggestions and analysis! I narrowed my search down to Symfony and CodeIgniter, but eventually chose CodeIgniter for its tiny footprint—smaller even than CakePHP's—with about the same level of features and code writing that I had grown accustomed to.

Let me put timeframes in perspective. I started studying CakePHP about six weeks ago. The first two weeks were dedicated to
  1. learning that .htaccess files were vital to CPHP's existence (this post I wrote rocketed to #2 on Google's search for 'cakephp htaccess'),
  2. getting CPHP to work with Eclipse, which I can't live without.
After another four weeks I had written 10 lines of custom code; the majority of that time was spent debugging every keyword.

Meanwhile, I picked up CodeIgnite Saturday morning. In half an hour I had it working with Eclipse. I didn't spend any time making sure .htaccess files were just-so because CI doesn't give a crap. An hour after that I had learned CI's syntax and produced a correctly working version of what I had attempted with CPHP. In all, CI demanded 0.15% the time needed for CPHP and I got what I expected.
posted by spamguy at 2:52 PM on June 28, 2008

« Older Blind shih-tzu separation anxiety   |   What movie was this? Newer »
This thread is closed to new comments.