Cake for beginners

A glossary of common terms

Note: This glossary is a work in progress. It does not cover all aspects of Cake, merely enough to enable beginners to understand terminology they may not be familiar with. It is not endorsed by or affiliated with the Cake developers. Please e-mail corrections to graham at grahambird dot co uk

C

Callback
A way of running some code before or after a Controller or Model method has fired. Cake has several callbacks including beforeSave and afterSave.
Component
These are snippets of Cake code (outside Controllers) that can be re-used.
Controller
Controllers are the files that contain all the logic. Controllers interact with Views to respond to server requests. A single Controller may contain various methods (like add, edit, delete).

E

Element
A file that can be loaded into a View via the renderElement() method.

F

Framework
In a web context, a (rapid development) framework is an application or set of scripts that speeds development of websites. For example, the .Net framework for ASP.Net, Django for Python, Rails for Ruby, Struts for Java and Cake for PHP.

H

Helper
A Helper is a set of methods designed to make it easier to do common tasks. For example, a Helper function might create a complete set of dropdowns for day, month and year to use in a form.

L

Layout
A Layout is a file containing HTML markup and Cake code. They enable you to re-use the same wrapper HTML on all of your Cake pages.

M

MVC (or Model View Controller)
MVC is a common way of separating applications into parts that interact with each other. Cake does things this way.
Model
A Model is a representation of a database table. Controllers interact with Models to get stuff to and from the database.

P

Pluralisation
Seen this in a Cake error? It probably means you have declared your Model or Controller classes wrongly. Remember they are case sensitive and model names must be singular (controllers must be plural).
<?
class Task extends AppModel {
	var $name = 'Task';
}
?>

S

Scaffold
A scaffold script interrogates your database structure and creates some basic content management functionality (eg add, edit, delete) thereby saving you a fair bit of work. A potential downside is that it may not build the system how you want it.
Scaffolding
Scaffolding means running a scaffold script.

V

View
Views manage the presentation of your data to the browser. They are snippets of code that display your data in different ways. You might have an index View, an add View and an edit View, all doing different things to your data.