11

Click here to load reader

Baking Cakes With Php

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Baking Cakes With Php

Baking Cakes with PHPCentral Florida PHP

1

Page 2: Baking Cakes With Php

Baking Cakes with PHP

• What Cake is and Why You Need It

• Ingredients

• A Couple of Models

• A Bunch of Views

• A Controller or Two

• A Pinch of ActiveRecord

2

Page 3: Baking Cakes With Php

What Cake Is and

Why You Need It

3

Page 4: Baking Cakes With Php

Cake is...

• A platform for rapid development

• MVC + AR

• Application Scaffolding

• Compatible with PHP4 and PHP5

4

Page 5: Baking Cakes With Php

MVC + AR = CakePHP

5

Page 6: Baking Cakes With Php

Model, View, Controller

• A design pattern for three tiers of data-driven applications

• Modes represent data

• Views represent the UI

• Controllers handle logic

6

Page 7: Baking Cakes With Php

Models

• Represent data used within an application

• Establish entity relationships

• hasOne, hasMany, belongsTo, hasManyAndBelongsTo

• Provide validation rules

7

Page 8: Baking Cakes With Php

Views

• Represent a page template

• Are directly associated with a controller’s action

• Usually are XHTML pages in a site, however may serve any content:

• RSS Feeds, Email Messages, etc...

8

Page 9: Baking Cakes With Php

Controllers

• Manage logic for a section of an app

• Act as a liaison between models and views

• Use actions to trigger functionality in an app

• index, view, add, edit, delete, etc...

9

Page 10: Baking Cakes With Php

ActiveRecord

• Another design pattern specifically reading and writing to a database

• Represents a single record

• Adds additional functionality to models for saving and destroying a record

• Eliminates manual SQL completely

10

Page 11: Baking Cakes With Php

Example anyone?

11