CakePHP: Bake

In my last post, on my initial thoughts on CakePHP I said:

"I'd be incredibly impressed if it had a wizard that let me create the shell for all of this automatically; including a wizard for setting up the database table for the model."

As it turns out, I wasn't far off. First, there's a file called bake.php which will, given a parameter or two, generate the controller and model and view files for you. Super handy. Even better is this third-party script called WebBaker. It's a web-based wizard that will allow you to specify what you'd like generated, including the different actions and corresponding view files.

All that's missing now is an integrated database table generator.

Published June 14, 2006 · Updated September 14, 2006
Categorized as CakePHP
Short URL: https://snook.ca/s/614

Conversation

14 Comments · RSS feed
Tim Adler said on June 15, 2006

If I may suggest another framework you might be interested in http://codeigniter.com/ .
Sounded very cool too!

Jonathan Snook said on June 15, 2006

Tim: I might try codeigniter when I have more time or if Cake ultimately doesn't serve my needs. My initial impression is that Cake has a larger user base which hopefully means more documentation and more people finding bugs and more people talking about things you can do with it.

Troy Schmidt said on June 15, 2006

Glad to see new people picking up on CakePHP. I use it in my distributed application for photographers peGallery. I just wanted to say that I found this one of the ONLY solutions for both PHP4, PHP5, WIndows and Linux. Also, I haven't used the wizards, but for developing AJAX applications that degrade it works well.

I really love this framework and was extremely pleased to do it. The only word of caution to newer bakers is to follow standards. The flexibility in CakePHP means that you can do things, but it doesn't mean you are doing it the way it was intended.

Tim Adler said on June 17, 2006

If I understand correctly, than Cake is like a framework for adding things to the DB and selecting from it. Also a MVC system is provided.

My question: Is there also something like a CMSsy backend, where you could actually put in some objects into the DB? I know that there is a Java framework which can do such a thing (http://riot.neteye.de) which makes a very neat and flexible CMS, after all!

Troy Schmidt said on June 17, 2006

No. It is a framework ONLY. No bloat, no unnecessary features. It's purpose is to provide a framework for rapid web application development. There is a CMS being developed on http://cakeforge.org.

Fredrik Wärnsberg said on June 18, 2006

"All that's missing now is an integrated database table generator."

RoR already has that. Seriously, check it out. Ruby is awesome once you start picking it up (im quite new myself but im already in love and prefer it over php). I just need to improve my object oriented programming (mainly private and protected methods).

Seth Thomas Rasmussen said on June 20, 2006

Rails++

I don't have a ton of experience with PHP, but I was never crazy about it. Ruby is a joy to use, and considering that Cake is an attempt capture what's hot about Rails in PHP, I'd suggest trying out Ruby and Rails one of these days.

Jonathan Snook said on June 20, 2006

Seth/Fredrik: Please don't get me wrong. I certainly want to try RoR at some point, along with Django. What I point out in this series of posts isn't to demonstrate that CakePHP is any better or worse but rather to document features as I use them for others who wish to use them as well.

In comparison, it'd be like me pointing out words in English that I like only to tell me that I should try Dutch or German because they're good, too. :)

Walker Hamilton said on June 24, 2006

Cake does have scaffolding (as do RoR and others). This is not something that should be used in a production environment, though.

I've been attending RailsConf2006 the past couple days and what these Rails "Gurus" are all saying is "Skip scaffolding". It's not worth it and it actually makes things harder on you, as the developer, in the long run.

Amy Hoy, one of the speakers, even did her session entirely about not using (and moving away from) scaffolding.

I love cake, I just think that the documentation needs to be worked on. I had been entertaining thoughts of making entries in the wiki when I figured something out that I could find nowhere else, but then I noticed that no one seems to be using just the wiki or just the manual (pdf or online versions) or just the API.

Andyman3000 said on June 26, 2006

I was waiting for something like this for php! Cake seems great. I just want 48 hour days...

@Seth:
how many web hosting companies do actually offer RoR Support? PHP is everywhere., even on free accounts.

Max said on July 02, 2006

Cake is still the best php framework out there for most projects. It has a rapidly growing user base, provides tremendous flexibility and extensibility.

I've checkout Zend Framework, and Code Igniter. Cake is still better.

RoR is an awesome framework. There are also some very compotent hosting companies that offer support for Ruby (such as networkredux.com)

The main draw back with RoR and Ruby is that:

1. Once the project is complete, there aren't enough programmers out there to support & assist with projects. (php programmers are everywhere)

2. Most ppl like me don't have the time to learn Ruby nor Rails.

I personally wish I had 36 hr days.

Steve Orr said on July 09, 2006

The main reason I've started using CakePHP instead of RoR for my site is the fact that my host doesn't support RoR. Very few shared hosts do, I've noticed, whereas pretty much all of them support PHP nowadays.

CakePHP is also superior in virtually every way to the 2 frameworks I tried before it, namely Symfony and Prado. Those 2 are very powerful, but, in trying to be a 'one size fits all' solution, they wind up bundling a large number of features that are unnecessary. Cake is much faster and easier to develop with.

But, I second the call for better documentation... it's the only bad thing about Cake so far!

Max said on August 18, 2006

They have done an excellent job of improving the manual ... however, there is still room for improvement.

The best way to get help for your questions is to just use the irc (http://irc.cakephp.org) ... those guys are extremely responsive and helpful.

Cake rulez!!!

Frederic Peña said on May 26, 2007

I have tested RoR, and even when it is easy for develop, special components like PDF, image Generation or so are easiest to find in abundance in PHP rather than Ruby.

Also there is more competent PHP programmers than Ruby (I mean Quantity), so expect more functionality and robustness in PHP

PHP rulez (until comes something better...)

Sorry, comments are closed for this post. If you have any further questions or comments, feel free to send them to me directly.