Learn How To Develop With CakePHP

9,119
-1

Published on

If you don't already use a PHP framework then this is for you. CakePHP is one of the more popular frameworks and is similar to RubyOnRails.

I will start you off at the very beginning as though you know nothing about CakePHP.

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total Views
9,119
On Slideshare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
254
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Learn How To Develop With CakePHP

  1. 1. Learn how to develop withCakePHP<br />Boston PHP : Michael Bourque<br />Part I<br />Feb 17th, 2010<br />
  2. 2. Welcome to Boston PHP<br />Started in 2002<br />Open styled meetings<br />66 Meetings so far<br />600 Members strong<br />Location, Location, Location<br />Boston, Cambridge, Norwell, Salem, Somerville, Quincy<br />MIT, Microsoft, BU<br />meetup.com/bostonphp<br />
  3. 3. Boston PHP Past Meetings<br />Learn how to create a FaceBook app<br />SHOW n&apos; TELL night<br />The ultimate PHP &quot;date night&quot;... Debugging and a movie<br />Framework Bake off...<br />Get Smart - Use Smarty!<br />Lessons from my.barackobama.com<br />jQuery and the Last Mile<br />PHP IDE Bake-Off <br />Mediawiki in production<br /><ul><li>Flex & the ZendFramework
  4. 4. An introduction to jQuery
  5. 5. The mystery of CSS and Design
  6. 6. Choosing an OSS license to match your business model
  7. 7. Developing, pricing & delivering OSS applications
  8. 8. How to get your OSS venture off the ground.
  9. 9. What is Agile Scrum?
  10. 10. Building the PHP-stack for the enterprise
  11. 11. Object-Relational Mapping (ORM) in action</li></li></ul><li>March 10: Cake PHP part II<br />Join us for part II in our series on CakePHP framework. Join Chris and Jesse Kochis as they give you a more in-depth advanced view of CakePHP.<br />
  12. 12. April 7: Enhance your apps jQuery<br />What is jQuery<br />How to install<br />Syntax<br />Review of the documentation<br />Practical uses of jQuery in your app<br />Light-box dialogs<br />Form validation<br />Effects such as Animation, Fading, Easing, Etc<br />Ajax<br />Page blocking<br />Progressive enhancements<br />How to use jQuery plugins<br />jQuery UI<br />More... <br />
  13. 13. Design an app without writing a single line of code<br />How to think about your app and start to experiment with your ideas<br />Prototyping tools<br />Prototyping single pages and user interactions<br />Creating a linkable prototype that looks almost like a working app<br />Exporting your prototype to the web for remote testing and design feedback<br />Paper prototyping and usability testing<br />Designing a great user experience with interaction design <br />
  14. 14. Startup/Hack Month<br />Come to the podium and post an idea for an app that does not yet exists or could be improved.<br />You should be willing to share this idea and not an idea that you’re not willing to share with others<br />Ask for volunteers to help you take your idea and conceptualize it into a low fidelity prototype<br />Work as a team onsite to produce the low fidelity prototype<br />Present your prototype to the audience<br />Plan with your team how best to build the app. <br />What technology you will use<br />What roles each other can play<br />How your team will work together<br />Come back to BostonPHP (one month later) and present your progress and demo what you have so far<br />Discuss what technology your using<br />Discuss how you were organized<br />What worked well, what didn’t<br />What you would like to do next<br />
  15. 15. PHP Security<br />Cross-Site Request Forgeries<br />Cross-Site Scripting<br />Session Fixation<br />Cross-Site Session Transfer<br />Pseudo-Random Number Generator Attacks<br />SQL Injection<br />Email Injection<br />Path Disclosure<br />Path Traversal<br />Request Value Fixation<br />Invalid Character Encoding<br />File Uploads<br />Password Hashing<br />Magic Quotes and Register Globals- Cryptography Mistakes<br />
  16. 16. Tell us what you want!<br />Learning series<br />Open source<br />Web development<br />Web design<br />Frameworks<br />Application design<br />…<br />Vote now!meetup.com/bostonphp/ideas<br />
  17. 17. Boston PHP : Volunteers needed<br />Webmaster<br />Logistics<br />Video cameraman<br />Topic Presenters<br />More…<br />
  18. 18. Boston PHP : Free<br />
  19. 19. Learn how to develop withCakePHP<br />Boston PHP : Michael Bourque<br />Part I<br />
  20. 20. Why a framework?<br />&lt;?php<br /> echo “why?”;<br /> ?&gt;<br />
  21. 21. What do most WebApps do?<br />Display HTML<br />Static pages<br />Dynamic pages<br />Forms<br />Handle form data<br />CRUD (Create, Read, Update, Delete)<br />Security<br />Authentication<br />Authorization<br />Caching<br />Etc…<br />
  22. 22. PHP Frameworks?<br />
  23. 23. Model, View, Controller<br />Tried and true software design pattern that is:<br />Maintainable<br />Modular<br />Ability to rapidly prototype <br />New features are easily added<br />Separate design allows developers and designers to work simultaneously<br />Separation allows developers to make changes in one part of the application without affecting others.<br />
  24. 24. Cake PHP Anatomy<br />
  25. 25. File and Classname Conventions <br />Filenames are underscored while classnames are CamelCased<br />So if you have a class MyNiftyClass, then in Cake, the file should be named my_nifty_class.php<br />
  26. 26. Model and Database Conventions<br />Model classnames are singular and CamelCased.<br />Table names corresponding to CakePHP models are plural and underscored.<br />people<br />tasks<br />users<br />Field names with two or more words are underscored like<br />first_name<br />Foreign keys<br />&lt;singular_table_name&gt;_id<br />
  27. 27. Controller Conventions<br />Controller classnames are plural, CamelCased, and end in Controller. <br />PeopleController and LatestArticlesController are both examples of conventional controller names.<br />
  28. 28. View Conventions<br />View template files are named after the controller functions they display, in an underscored form. <br />The getReady() function of the PeopleController class will look for a view template in /app/views/people/get_ready.ctp.<br />
  29. 29. Documentation : The Bakery<br />
  30. 30. Let’s get started : Installation<br />Basic knowledge of PHP<br />Basic knowledge of Databases<br />You know how to create database tables with MySQL<br />A working development environment on your Laptop<br />Apache 2.2.x<br />MySQL 5.x <br />PHP 5.3.x or 5.2.x<br />PHPMyAdmin<br />IDE (Any good text editor like Notepad+, TextMate, Etc)<br />CakePHP 1.2.x<br />http://tinyurl.com/yekjbae<br />
  31. 31. What our simple app will do<br />Keep track of tasks<br />Create<br />Read<br />Update<br />Delete<br />Created<br />Modified<br />
  32. 32. Design the database<br />Design a DB to hold your data<br />All tables should include an ID field<br />
  33. 33. Bake an app<br />Design a DB to hold your data<br />All tables should include an ID field<br />
  34. 34. Add more ingredients<br />Add more data and fields<br />Add users<br />Add status<br />Add validation<br />Add css, and change the layout<br />Change terminology<br />
  35. 35. Some Tips<br />Create multiple apps all coming from one CakePHP distribution<br />Model::displayField<br />Scaffolding<br />Layout, and css<br />Localization<br />__(“string”,true);<br />
  36. 36. Thank you<br />Special thank you to MIT<br />BEER and Food!<br />See you at the next meetup<br />Contact me <br />michael.bourque@gmail.com<br />

×