Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

CakePHP: An Introduction


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

CakePHP: An Introduction

  1. 1. CakePHP: An Introduction Diana Jayne Gonzales Wingcast Inc.
  2. 2. What is CakePHP?
  3. 3. Framework Avoids re-inventing the wheel
  4. 4. 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
  5. 5. 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
  6. 6. Features
  7. 7. PHP4 and 5 compatible
  8. 8. Multiple DBs
  9. 9. ORM - Object Record Mapper DB Objects
  10. 10. Validation
  11. 11. Caching
  12. 12. AJAX
  13. 13. Auth Module - Access Lists
  14. 14. Huge Code Base of Components and Plugins
  15. 15. 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. application-development-cakephp) ●CakePHP for Beginners: Tutorials ( uk/cake/tutorials/) ●CakePHP Manual (
  16. 16. Directory Structure ●app/ ○config/ ○controllers/ ○models/ ○plugins/ ○tmp/ ○vendors/ ○views/ ○webroot/ ●cake/ ○config/ ○docs/ ○libs/ ●vendors/
  17. 17. Installing CakePHP
  18. 18. Get
  19. 19. Unzip to /var/www/
  20. 20. Rename folder to 'cake'
  21. 21. define('ROOT', BASE_DIR.'/path_to_cake_ins tall'); define ('APP_DIR', 'app'); define ('WEBROOT_DIR', '/public_html'); to app/webroot/index. php
  22. 22. Set up mod_rewrite
  23. 23. Setup database on config/database.php
  24. 24. 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
  25. 25. Exercise: Scaffolding a Bookmarks Manager automated way of generating a view based on the model
  26. 26. Exercise: Login
  27. 27. Exercise: AJAX Task List