CakePHP: An Introduction

godiane 2,574 views 28 slides Sep 30, 2013
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation

No description available for this slideshow.


Slide Content

CakePHP: An Introduction
Diana Jayne Gonzales
Wingcast Inc.

What is CakePHP?

Framework
Avoids re-inventing the wheel

Cake is for you if you want to...
do more things in less time
use a framework
like ROR
stop creating the same codes
over and over again
templating
searchable URLs
use MVC
use a framework that is suitable for all types of apps

What Cake will do for you?
●eases creation of standard content management functionality
(adding, editing and deleting)

●uses template-like Layouts and Views to separate logic from
presentation

●validates form fields

●automatically escapes data saved to the database (to
prevent SQL injection attacks)

●includes callbacks (eg. do an action before or after save)

●allows for both test and production databases

Features

PHP4 and 5 compatible

Multiple DBs

ORM - Object Record Mapper
DB Objects

Validation

Caching

AJAX

Auth Module - Access Lists

Huge Code Base of
Components and Plugins

Resources
●Taking A Look on 10 Different Frameworks (http://www.phpit.
net/article/ten-different-php-frameworks/)

●Cook Up Websites Fast with CakePHP (http://www.scribd.
com/doc/5503/
CakePHP-tutorial-no-1-from-IBM)

●The CakePHP Framework: Your First Bite (http://www.
sitepoint.com/article/
application-development-cakephp)

●CakePHP for Beginners: Tutorials (http://grahambird.co.
uk/cake/tutorials/)

●CakePHP Manual
(http://docs.huihoo.com/php/CakePHP-Manual/)

Directory Structure
●app/
○config/
○controllers/
○models/
○plugins/
○tmp/
○vendors/
○views/
○webroot/
●cake/
○config/
○docs/
○libs/
●vendors/

Installing CakePHP

Get cake_1.1.17.5612.zip

Unzip to /var/www/

Rename folder to 'cake'

define('ROOT',
BASE_DIR.'/path_to_cake_ins
tall');
define ('APP_DIR', 'app');
define ('WEBROOT_DIR',
'/public_html');

to app/webroot/index.
php

Set up mod_rewrite

Setup database on
config/database.php

Scaffolding
●analyzes your database tables

●creates standard lists with add, delete and edit buttons

● standard forms for editing and standard views for inspecting
a single item in the database

Exercise: Scaffolding a
Bookmarks Manager
automated way of generating a view
based on the model

Exercise: Login

Exercise: AJAX Task List