In a previous post where I rambled on about what I was thinking about I briefly talked about bake, the wonderful tool that comes with CakePHP. In the comments for that post I was asked by ‘keymaster’ to expand a bit on why bake is such a powerful tool. In a nutshell: it creates a skeleton for EVERYTHING that you will need.
At Cake Development Corporation it’s our secret weapon that allows us to build out a site faster than our competition. With bake I can build the following:
- If I’ve already created my database tables following CakePHP conventions, I can create models, along with all their associations (the belongsTo, hasMany, etc
- Create controllers, and even create not only the common CRUD actions but create the admin-related actions as well
- Create views for the CRUD actions AND the admin-related ones too
That’s 99% of the work taken care of for me! Why *wouldn’t* you want to use a tool like that? Part of the reason people have been slow to come around to using it is because, well, there is no graphical interface for it. It’s all command line, and for those developers who work on Windows, using the command-line is often a daunting task. It’s not their fault, really. Windows is a graphical environment after all. For OS-X types like me, I just pop open a terminal and start baking. I highly suggest people go and watch gwoo’s screencasts about setting up the CakePHP console for both *NIX environments (including OS-X) and Windows. By installing the console, you can access bake by simply typing ‘cake bake’ in the root directory of your app.
Recent additions to bake like the ability to specify your own templates for views means that you can roll out a slightly-customized version of a site even faster. There are enhancement requests in the CakePHP development queue to extend the abilities of bake to create components, helpers and plugins. A great tool just keeps on getting better! Now that I use bake as part of my regular work habits, I ask myself “how the hell did I ever create anything without it before?”


What do you mean create components and helpers? Do you mean add them to controller or actually create them?
@Joshua – I mean actually create them
I’m new to the whole Cake thing, and MVC development in general, but what I am is lazy
. When I saw the screencast for Bake, my jaw hit the floor. Since then I’m actually cranked out 2 full blown usable (not perfect, I’m still learning after all) sites with a minimum of muss ans fuss.
–
Baz L
Day In The Life of Baz
I use bake and like it.
But it really would be better to use GUI (PHP web-page).
Also many people like me have development server at other computer. I need to bake from VNC window – it’s not that funny because it works bad with console application.
You could make online bake like chat applications (AJAX or frames). Developer types message in the bottom and bake processes it.
@Chris, amen to that! Bake saves me about a weeks worth of work on every project.
@how, it’s funny you say that since I’m working on a cake baker GUI as we speak, only not command-line style, but form-based.
@housebolt, Wow! Is there any beta available?
Bake is outstanding. I agree wither earlier comments. It has and continues to save me loads of time on my projects. CakePHP is general is fantastic.