Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Cook up websites fast with CakePHP, Part 1: Getting started with CakePHP

Quick and easy PHP rapid-development aid

Duane O'Brien, PHP developer, Freelance
Duane O'Brien has been a technological Swiss Army knife since the Oregon Trail was text only. His favorite color is sushi. He has never been to the moon.

Summary:  CakePHP is a stable production-ready, rapid-development aid for building websites in PHP. This "Cook up websites fast with CakePHP" series shows you how to build an online product catalog using CakePHP. Part 1 focuses on getting CakePHP up and running, and the basics of how to put together a simple application allowing users to register for an account and log in to the application.

View more content in this series

Date:  15 Jan 2013 (Published 21 Nov 2006)
Level:  Intermediate PDF:  A4 and Letter (827 KB | 29 pages)Get Adobe® Reader®

Activity:  355640 views
Comments:  

Before you start

11 Jan 2013 - Editor's note: This series was originally published in 2006, and has undergone several revisions since to keep up with ongoing developments on CakePHP. This revision was written for CakePHP 2.1.1.

This "Cook up websites fast with CakePHP" series is designed for PHP application developers who want to start using CakePHP to make their lives easier. In the end, you will have learned how to install and configure CakePHP, the basics of Model-View-Controller (MVC) design, how to validate user data in CakePHP, how to use CakePHP helpers, and how to get an application up and running quickly using CakePHP. It might sound like a lot to learn, but don't worry—CakePHP does most of it for you.

About this series

  • Part 1 focuses on getting CakePHP up and running, and the basics of how to put together a simple application allowing users to register for an account and log in to the application.
  • Part 2 demonstrates how to use scaffolding and Bake to get a jump start on your application, and how to use CakePHP's access control lists (ACLs).
  • Part 3 shows how to use Sanitize, a handy CakePHP class, which helps secure an application by cleaning up user-submitted data. Part 3 also covers the CakePHP Security component, handling invalid requests and other advanced request authentication.
  • Part 4 focuses primarily on the Session component of CakePHP, demonstrating three ways to save session data, as well as the Request Handler component to help you manage multiple types of requests (mobile browsers, requests containing XML or HTML, and so on).
  • Part 5 deals with caching, specifically view and layout caching, which can help reduce server resource consumption and speed up your application.

About this tutorial

This tutorial shows how to get started using CakePHP. You'll go through the installation process, then get down and dirty by writing the user registration code. Through it all, you'll see how much time you could have saved had you been using CakePHP all along. This part of the tutorial builds the online product application, Tor, which includes a "request dealership username and password" page and a login page.

CakePHP topics include:

  • MVC design
  • Helpers
  • CakePHP data validation

Prerequisites

It is assumed that you are familiar with PHP, have a fundamental grasp of database design, and are comfortable getting your hands dirty. A full grasp of the MVC design pattern is not necessary, as the fundamentals will be covered during this tutorial. More than anything, you should be eager to learn, ready to jump in, and anxious to speed up your development time.


System requirements

Before you begin, you need to have an environment in which you can work. CakePHP has reasonably minimal server requirements:

  1. An HTTP server that supports sessions (and preferably mod_rewrite). This tutorial was written using Apache 2.2.21 with mod_rewrite enabled.
  2. PHP 5.2.8 or later (including PHP V5). This tutorial was written using PHP V5.3.8.
  3. A supported database engine. This tutorial was written using MySQL 5.5.23.

You'll also need a database ready for your application to use. The tutorial will provide syntax for creating any necessary tables in MySQL.

The simplest way to download CakePHP is to visit CakePHP.org and download the latest stable version from the Get products and technologies section of Resources. This tutorial was written using 2.1.1.

1 of 10 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source
ArticleID=390462
TutorialTitle=Cook up websites fast with CakePHP, Part 1: Getting started with CakePHP
publish-date=01152013
author1-email=d@duaneobrien.com
author1-email-cc=