CakePHP Fundamentals - 1.2 @ OCPHP

download CakePHP Fundamentals - 1.2 @ OCPHP

of 40

  • date post

    10-May-2015
  • Category

    Technology

  • view

    4.431
  • download

    3

Embed Size (px)

description

This is a file I found a couple of days ago on the web. © Cake Software Foundation - http://cakefoundation.org/

Transcript of CakePHP Fundamentals - 1.2 @ OCPHP

  • 1.CakePHP Bakery API Manual Forge Trac 1.2 @ OCPHPAugust 9, 2007 2007 Cake Software Foundation

2. CakePHP Bakery API Manual Forge Trac Why CakePHP? MVC architecture Convention over Conguration Flexible and Extensible Write less, do more Open Source, Large Community MIT License 2007 Cake Software Foundation 3. CakePHP Bakery API Manual Forge TracCakePHP the right wayby: Amy Hoy, http://slash7.com/ Think twice, code onceLoose couple 2007 Cake Software Foundation 4. CakePHP Bakery API Manual Forge TracHot out of the oven BehaviorsRouterWith AssociationsEmailEnhanced ValidationSecurityFormsAuthenticationPagination Congurei18n + l10nCache EnginesAclConsole 2007 Cake Software Foundation 5. CakePHP Bakery API Manual Forge TracBehaviors extend models encapsulate reusable functionality use callbacks for automagic 2007 Cake Software Foundation 6. CakePHP Bakery API Manual Forge Trac 2007 Cake Software Foundation 7. CakePHP Bakery API Manual Forge Trac 2007 Cake Software Foundation 8. CakePHP Bakery API Manual Forge TracWith Associations enables extra elds in join tables access to model for join table tagsposts posts_tag idids keytitle idnamebodypost_id createdcreated tag_idmodiedmodied date 2007 Cake Software Foundation 9. CakePHP Bakery API Manual Forge Trac Adding With 2007 Cake Software Foundation 10. CakePHP Bakery API Manual Forge Trac Using With 2007 Cake Software Foundation 11. CakePHP Bakery API Manual Forge TracValidation is KingalphaNumericemail numberbetween equalTo numericblank le phoneccippostalcomparisonmaxLength ssncustomminLength urldatemoney userDeneddecimal multiple 2007 Cake Software Foundation 12. CakePHP Bakery API Manual Forge Trac Using Validation 2007 Cake Software Foundation 13. CakePHP Bakery API Manual Forge TracForms made simple 2007 Cake Software Foundation 14. CakePHP Bakery API Manual Forge TracMore about Forms 2007 Cake Software Foundation 15. CakePHP Bakery API Manual Forge Trac CREATE TABLE i18n ( CREATE TABLE i18n_content ( id int(10) NOT NULL auto_increment, id int(10) NOT NULL auto_increment, locale varchar(6) NOT NULL, content text, i18n_content_id int(10) NOT NULL, PRIMARY KEY (id) model varchar(255) NOT NULL,); row_id int(10) NOT NULL, eld varchar(255) NOT NULL, PRIMARY KEY (id), KEY locale (locale), KEY i18n_content_id (i18n_content_id), KEY row_id(row_id), KEY model (model), KEY eld (eld)); 2007 Cake Software Foundation 19. CakePHP Bakery API Manual Forge TracAcl abstracted for maximum compatibility component for controller behavior for model 2007 Cake Software Foundation 20. CakePHP Bakery API Manual Forge Trac Acl behavior }function roles() {return $this->Aro->ndAll(); } } ?> 2007 Cake Software Foundation 21. CakePHP Bakery API Manual Forge TracRouting reverse routes magic variables named parameters parseExtensions REST resource mapping 2007 Cake Software Foundation 22. CakePHPBakery API Manual Forge TracReversing Routes 2007 Cake Software Foundation 23. CakePHP Bakery APIManual Forge TracMagic Variables $Action => Matches most common action names $Year => Matches any year from 1000 to 2999 $Month => Matches any valid month with a leading zero (01 - 12) $Day=> Matches any valid day with a leading zero (01 - 31) $ID=> Matches any valid whole number (0 - 99999.....)Router::connect( '/:controller/:year/:month/:day', array('action' => 'index', 'day' => null), array('year' => $Year, 'month' => $Month, 'day' => $Day)); Router::connect( '/:controller/:id',array('action' => 'index', id=> 1), array('id' => $ID)); 2007 Cake Software Foundation 24. CakePHP Bakery API Manual ForgeTrac Named Args http://cakephp.org/posts/index/page:2/sort:title 2007 Cake Software Foundation 25. CakePHP Bakery API Manual Forge TracParsing Extensions/* get everything */Router::parseExtensions();/* more ne grained */Router::parseExtensions(xml, html); maps views to unique locationshttp://cakephp.org/posts/index.rss Router::parseExtensions(rss);