Your SlideShare is downloading. ×
0
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Intro to CakePHP 1.3
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Intro to CakePHP 1.3

1,236

Published on

This is a CakePHP 101 talk covering a basic intro to CakePHP 1.3 for developers who have never used this framework.

This is a CakePHP 101 talk covering a basic intro to CakePHP 1.3 for developers who have never used this framework.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,236
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Intro to CakePHP South Florida PHP Users Group Adam Culp http://www.Geekyboy.comIn this presentation we will cover an introduction to CakePHP which I hope will allow the participants to start experimenting on their own.
  • 2. Intro to CakePHPWhat is CakePHP?CakePHP is a rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. Using commonly known design patterns like MVC and ORM within the convention over configuration paradigm, CakePHP reduces development costs and helps developers write less code.
  • 3. Intro to CakePHPWhat?CakePHP is a framework of core stuff already done, that enables a developer to create things quickly! Thus saving themselves and companies time and money.Current version: 1.3 with 2.0 coming soon Runs on: PHP 4 and 5 up to 5.3 (recommended) Has a command line tool to automate code creation for both Windows and Linux.
  • 4. Intro to CakePHPLets dig in!2. Download CakePHP3. Unzip4. Setup Apache (or your favorite web server)5. IT WORKS!!!
  • 5. Intro to CakePHPStructure• Cake is an OOP framework that utilizes an MVC design pattern. – Model = Data – View = Presentation – Controller = Logic and Direction• Config = settings files• Vendors = 3rd party and CRONs• Webroot = public – Contains the js, css, images• URL rewrite (.htaccess) makes it work
  • 6. Intro to CakePHPCakePHP conventions• Database table (plural) – products, categories• Controller naming (plural) – products_controller.php / ProductsController – categories_controller.php / CategoriesController• Model naming (singular) – product.php / Product – category.php / Category• View naming – products / index.ctp – category / index.ctp
  • 7. Intro to CakePHPViews keep design simple and easy• “Layout” = overall page appearance• “Elements” allow breaking up design elements from main layout.• “Pages” are handy for static content pages, where you don’t really need a controller or model.• “Routes” allow added rules to be created, and make Pages even more friendly to designers and SEO.
  • 8. Intro to CakePHPTo Zend Studio >>>Set up basic public and admin layout, with element for header, footer, sidebar, and menuAlso create base pages: Home, About, Contact
  • 9. Intro to CakePHPTake care of security and database• Initial screen prompts to “make it yours”. – Set Security.salt – Set Security.cipherseed – If PHP 5.3 set default timezone – Prefix Routing (admin, client) – Add a database • Rename ‘database.php.default’ to ‘database.php’ and customize…done!• >>> To Zend Studio
  • 10. Intro to CakePHPDB Field names and how CakePHP uses them:• Id –used as the primary key(UUID or int)• Name/Title – Cake will automatically map use this as a label in many circumstances.• Created – (datetime) Cake will automatically fill• Modified – (datetime) Cake will automatically fill• Foreign key fields = {model}_id (product_id, category_id)• >>> to phpmyadmin
  • 11. Intro to CakePHPIt does console too!• There is a very handy command line tool called “bake” that is a great code generation tool to get you started FAST!• Make sure to add the cake console to your operating systems PATH. – Windows = manual – Ubuntu = automated if cakephp installed with apt-get• >>> To the command prompt
  • 12. Intro to CakePHPTweaking• The “Look” by changing layout.• Adding ‘empty’ to dropdowns in the View.• Setting default values for checkboxes.• Using routes to simplify URLs. – Instead of ‘/pages/about’ we can use ‘/about’.
  • 13. Intro to CakePHPCRON jobs and Scheduled Tasks made easy• Create a php file in the ‘app/vendors/shells’.• The ‘main’ function is always run.• Kick off via command line, and get the benefits of the CakePHP framework. (models, etc.)
  • 14. Intro to CakePHP Questions?
  • 15. Intro to CakePHPResources• http://cakephp.org• http://book.cakephp.org• http://apachefriends.org• http://phpmyadmin.net• Come join us: Meetup, Facebook, LinkedIn – http://www.facebook.com/groups/128325450542999 – http://www.linkedin.com/groups?gid=3578819 – http://www.meetup.com/South-Florida-PHP-Users-Group

×