Baking Cakes With Php

1,873 views

Published on

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
1,873
On SlideShare
0
From Embeds
0
Number of Embeds
43
Actions
Shares
0
Downloads
110
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Baking Cakes With Php

  1. 1. Baking Cakes with PHP Central Florida PHP 1
  2. 2. 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
  3. 3. What Cake Is and Why You Need It 3
  4. 4. Cake is... • A platform for rapid development • MVC + AR • Application Scaffolding • Compatible with PHP4 and PHP5 4
  5. 5. MVC + AR = CakePHP 5
  6. 6. Model,View, Controller • A design pattern for three tiers of data- driven applications • Modes represent data • Views represent the UI • Controllers handle logic 6
  7. 7. Models • Represent data used within an application • Establish entity relationships • hasOne, hasMany, belongsTo, hasManyAndBelongsTo • Provide validation rules 7
  8. 8. 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
  9. 9. 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
  10. 10. 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
  11. 11. Example anyone? 11

×