Cake for beginners

A quick guide for the curious

Note: This guide is not endorsed by or affiliated with the Cake developers. I just wrote it because I recently discovered Cake and had lots of questions. I thought other people might be in the same boat. Please e-mail corrections to graham at grahambird dot co uk

What is Cake?

Cake is a framework for PHP in the same way that Rails is for Ruby. Essentially, it's a tool designed to help PHP developers avoid reinventing the wheel all the time.

Is Cake for me?

Cake is for you if:

Is Cake better/worse than Rails?

Cake follows the same MVC model that other frameworks typically use, and I think it's fair to say that the developers were initially inspired by Rails. However, because Ruby is different to PHP, I don't think the two frameworks can be directly compared.

The way I look at it, Rails is a great idea, but to use it you need to learn a new language and have specialised hosting.

On the other hand, with Cake you can stay in familiar territory (PHP) and use pretty much any host while enjoying the benefits of a frameworked approach.

What will Cake do for me?

Some of the things Cake does so you don’t have to:

What do I need to run Cake?

Any hosting package with Apache, PHP 4.3.2 or higher and MySQL. If mod_rewrite is enabled it will allow you to use nice, search-friendly URLS. Cake does run on IIS too.

Can I install Cake myself?

Yes, as long as you can FTP to your webspace. You can get Cake running without any configuration changes from your host.

Will I need to run things from the command-line?

No.

What is scaffolding and does Cake do it?

Essentially, scaffolding means running a script over your database structure to automatically create some basic content management functionality (ie web forms). And yes, Cake does do scaffolding. See my scaffolding tutorial for more info.

What about Ajax?

Yes, Cake includes Ajax functions too. My Ajax task list tutorial is an introduction to Cake with Ajax.

How do I use CSS, Javascript and other stuff with Cake?

You can store all your non-Cake files (css, javascript, images, etc) in a separate folder.

OK, I want Cake!

Download the most recent version from CakeForge.

Where can I get more info about Cake?

You can visit the official website, read the Wiki or post to the Google Group.