CakePHP Application Development


CakePHP Application Development
eBook: $23.99
Formats: PDF, PacktLib, ePub and Mobi formats
$14.39
save 40%!
Print + free eBook + free PacktLib access to the book: $63.98    Print cover: $39.99
$39.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Develop cutting-edge Web 2.0 applications, and write PHP code in a faster, more productive way
  • Walk through the creation of a complete CakePHP Web application
  • Customize the look and feel of applications using CakePHP layouts and views
  • Make interactive applications using CakePHP, JavaScript, and AJAX helpers
  • Ready for the forthcoming release of CakePHP 1.2

Book Details

Language : English
Paperback : 332 pages [ 235mm x 191mm ]
Release Date : July 2008
ISBN : 1847193897
ISBN 13 : 9781847193896
Author(s) : Ahsanul Bari, Anupom Syam
Topics and Technologies : All Books, Web Development, Open Source, PHP


Table of Contents

Preface
Introduction to CakePHP
A Quick Installation
A Quick App
Controllers: Programming Application Logic
Models: Accessing Data
ORM: Modelling the Table Relationship
Views: Creating User Interfaces
Using Shells: Get Further, Faster
Making Quickwall: The Basics
Quickwall: User Authentication
Quickwall: JavaScript and AJAX
Quickwall: Making It Better
Index
  • Preface
    • What This Book Covers
    • Who is This Book for
    • Conventions
    • Reader Feedback
    • Customer Support
      • Downloading the Example Code for the Book
      • Errata
      • Questions
  • Introduction to CakePHP
    • What is CakePHP?
      • A PHP Framework
      • Common Design Patterns
      • Rapid Web Development
      • Works with PHP4 and PHP5
      • CakePHP is Free and Open Source
    • Improved Code Structure
      • Understanding the MVC Pattern
      • Models
      • Controllers
      • Views
      • How It Works
    • Faster Development
      • Less Configuration, More Convention
      • Auto Code Generation
      • Quick Access to Related Data
      • Built-in Commonly Used Functionalities
    • Versions of CakePHP: 1.1 and 1.2
    • Summary
  • A Quick Installation
    • Downloading CakePHP
    • Platform Requirements
    • Configuring Apache
      • AllowOverwrite is Set to All
      • Mod_rewrite Module is Loaded
    • Setting Up Cake in Web Root
    • Running Cake for the First Time
    • Summary
  • A Quick App
    • Making Sure the Oven is Ready
    • CakeTooDoo: a Simple To-do List Application
    • Configuring Cake to Work with a Database
    • Writing our First Model
    • Writing our First Controller
    • Viewing All Tasks in CakeTooDoo
    • Adding a New Task
    • Editing a Task
    • Adding Data Validation
    • Deleting a Task from CakeTooDoo
    • Viewing Completed Tasks and Pending Tasks
    • Formatting Date and Time
    • Creating the CakeTooDoo Homepage
    • Summary
  • Controllers: Programming Application Logic
    • Interacting with Model
      • Attaching Models and Controllers
    • Action, Parameters, and Views
      • Interacting with View
      • Actions and Parameters
      • Getting Post Data from the View
    • Redirecting
    • AppController: The Parent Controller
    • Working with Components
    • Summary
  • Models: Accessing Data
    • Setting Up Database and Models
      • Creating a Model for a Database Table
    • Retrieving Data
      • Using Model to Retrieve Data
      • More on Data Retrieval
    • Saving and Updating Data
      • Saving Data
      • Updating a Record
      • More on the save() Method
      • Updating a Single Field
      • Batch Update
    • Deleting Data
      • Deleting a Single Record
    • Placing Your Own Logic Inside Model
      • Create and Use Your Own Model Method
    • Validating Your Data
      • Adding Validation to Our Model
    • Summary
  • ORM: Modelling the Table Relationship
    • Working with Simple Associations
      • Defining One-To-Many Relationship in Models
      • Retrieving Related Model Data in One-To-Many Relation
      • Saving Related Model Data in One-To-Many Relation
      • Adding More than One Association of the Same Type
      • One-To-One Relation
      • Customizing Association Characteristics
    • Working with Complex Associations
      • Defining Many-To-Many Relationship in Models
      • Retrieving Related Model Data in Many-To-Many Relation
      • Saving Related Model Data in Many-To-Many Relation
      • Deleting Associated Data
      • Changing Association On The Fly
    • Summary
  • Views: Creating User Interfaces
    • Working with Layouts
      • Creating Custom Layouts
    • Using Elements
      • Creating and Using Element
    • Working with Helpers
      • Creating and Using Your Own Helper
      • Creating Forms to Take User Input
    • Summary
  • Using Shells: Get Further, Faster
    • Setting Up the Cake Shell
      • Setting Up the Cake Shell in Windows
      • Setting Up the Cake Shell in *nix
    • Baking an Application
      • Creating and Configuring the Database
      • Baking Models
      • Baking Controllers
      • Baking Views
    • Summary
  • Making Quickwall: The Basics
    • What is This Quickwall All About?
    • Setting Up Cake
    • Creating and Connecting the Database
    • Creating and Defining Relationships between Models
    • Creating the Basic Controller Actions and Their Views
    • Adding Custom Layout
    • Adding Forms to Add New Questions and Answers
    • Summary
  • Quickwall: User Authentication
    • Creating the User Model and the Users Controller
    • Making the User Sign Up Process
    • Adding Email Confirmation to Sign Up
    • Integrating Authentication: Database and Models
    • Integrating Authentication: Controllers
    • Integrating Authentication: Views
    • Remembering User with Cookie
    • Summary
  • Quickwall: JavaScript and AJAX
    • Adding JavaScript Validation
    • AJAX Link to Show Own Questions
    • AJAX AutoComplete to Search Users
    • AJAX Form Submit to View Questions of a User
    • In-Line Editing to Edit Own Answers
    • Summary
  • Quickwall: Making It Better
    • Making Dates More Readable
    • Creating a User Page
    • Linking the Search Page to the User Page
    • Adding Pagination
    • Adding RSS Feeds
    • Summary

Ahsanul Bari

Ahsanul Bari is a web application developer from Dhaka, Bangladesh. After graduating from North South University with a bachelor's degree in Computer Science, he has been involved in developing various web applications for local businesses. At a very early stage of his career he felt the need for tools and techniques to build structured and maintainable web applications. That is when he found out about CakePHP. It was love at first sight and he decided to use CakePHP for his future projects. He never had to look back, and from then on he has been heavily using CakePHP for all kinds of projects. Most notably, using CakePHP, he developed an ERP solution for companies involved in urban and land development.

Apart from that, he has also 'irregularly' contributed to the CakePHP Documentation Team. He is also an 'irregular' blogger (http://ahsanity.com and http://ahsanity.wordpress.com). Just when people start to think that he has given up blogging, he is known to write a post from nowhere! Among his friends and colleagues, he is known as a fanboy for CakePHP.

Currently he is working at Trippert Labs, where he has been involved in making a travel-based blogging system, http://www.trippert.com.


Anupom Syam

Anupom Syam is a web application developer from Dhaka, Bangladesh. He started programming back in 1998 in C when he was a high school kid. In his early university years, he met Java and fell in love immediately. Through the years he has become proficient in various aspects of Java (ME, SE, and EE). Early in his career he was engaged mainly in building localized mobile applications. Over time his interest in web technologies grew and he did not hesitate to jump onto the Web 2.0 bandwagon. Over the last five years he has been working with different startups and building web/mobile applications. He currently works as a Development Engineer at Trippert, Inc. where he has been involved in developing a travel-based blogging system http://www.trippert.com (which is developed using CakePHP) as the lead back-end programmer.

He loves to build rich-client web apps with JavaScript/AJAX in the front end and CakePHP/RoR/MySQL in the back end. He still uses Java heavily for his personal fun-time projects. He also maintains blogs: http://anupom.wordpress.com and http://syamantics.com. Besides programming he is interested in many things, ranging from the most recent scientific discoveries to ancient Vedic philosophies.

Sorry, we don't have any reviews for this title yet.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 12 submitted: last submission 07 Nov 2013

Errata type: Typo | Page number: 59

Typo. on paragraph 3, line 2: "...://localhost/applogic/maths/add_digit/1/2/3" Should read: "...://localhost/applogic/maths/add_digits/1/2/3"

 

Errata type: Typo | Page number: 25

This line: Our database, which we named caketoodoo, has only one table named task. Should be: Our database, which we named caketoodoo, has only one table named tasks. i.e.'tasks' instead of 'task'.

 

Errata type: Typo | Page number: 59

Typo. on paragraph 3, line 2: "...://localhost/applogic/maths/add_digit/1/2/3" Should read: "...://localhost/applogic/maths/add_digits/1/2/3"

 

Errata type: Others | Page number: 69

$id = $this->Util->strip_and_clean($id); should be $id = $this->Util->strip_and_clean($id, $books);

 

Errata type: Others | Page number: 83

'conditions' => array('Book.title' => 'LIKE A%'), should read: 'conditions' => array('Book.title LIKE' => 'A%'),

 

Errata type: Typo | Page number: 83

T'conditions' => array('Book.title' => 'LIKE A%'), should read: 'conditions' => array('Book.title LIKE' => 'A%'),

 

Errata type: Typo | Page number: 121

When editing the two model files it should be: app/models/author.php app/models/book.php and not app/models/authors.php app/models/books.php

 

Errata type: Typo | Page number: 129

Create a view for the action '/books/add' (/app/views/add.ctp) should be Create a view for the action '/books/add' (/app/views/books/add.ctp

 

Errata type: Others | Page number: 199

Item 1 under Time for Action states to create a file named 'answers.php.' It should be 'answer.php'

 

Errata type: Code | Page number: 220

'rule' => array('minLenght', 1); should read 'rule' => array('minLength', 1);

 

Errata type: Code | Page number: 227

'rule' => array('minLenght', 1); should read as 'rule' => array('minLength', 1);

 

Errata type: Code | Page number: 228

'rule' => array('minLenght', 1); should read 'rule' => array('minLength', 1);

 

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

CakePHP Application Development +    ADempiere 3.4 ERP Solutions =
50% Off
the second eBook
Price for both: $40.05

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

  • Develop well-structured applications faster, using CakePHP's MVC
  • Install and set up CakePHP
  • Create and configure your database to build a bookmark manager interface step by step
  • Build a model that that integrates with your database and provides basic features to your application: inserts, updates, deletes, searches, and relationships
  • Create views that present the user interface in an attractive, organized, and maintainable way
  • Develop controllers to interact with model classes, use callback functions, and create reusable components
  • Prototype applications fast using scaffolding to auto-generate user interface code
  • Create custom user interfaces using layouts, elements, helper classes, and CakePHP's FormHelper
  • Build complex data models with multiple related tables, using Cake associations
  • Enhance your data models by adding new functionalities like user authentication and data validation
  • Automate repetitive tasks and speed up development using shells
  • Reduce the amount of code you write yourself using Bake to automatically generate essential code based on your database design
  • Add interactivity using JavaScript and AJAX
  • Work with user pages, search, pagination, and RSS

In Detail

Cake is a rapid development framework for PHP that uses well-known design patterns and provides a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss of flexibility. It means you can code faster, your code is better, and it makes writing Web 2.0-style apps a snap.

This book offers step-by-step instructions to learn the CakePHP framework and to quickly develop and deploy web-based applications. It introduces the MVC pattern and coding styles using practical examples. It takes the developer through setting up a CakePHP development and deployment environment, and develops an example application to illustrate all of the techniques you need to write a complete, non-trivial application in PHP. It aims to assist PHP programmers to rapidly develop and deploy well-crafted and robust web-based applications with CakePHP.

A step-by-step introduction to rapid web development using the open-source MVC CakePHP framework

Approach

This book starts by installing Cake and building our first application, then looking at each main component of a CakePHP application in detail. We then learn how to build Web 2.0 style applications quickly using a case study application. The book is packed with example code and demo applications, so that you can see techniques in action.

Who this book is for

If you already know PHP and want to develop cutting-edge Web 2.0 applications, or see how to write code in a faster, more productive way, then this book is ideal for you.

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software