bake byCakePHP2.0   Bansystems Inc      Yosuke Konno         1
2
yeah!          TEAM MontbancSucks                                           ■                                             ...
bake          bake               bake       bake   search plugin                 4
bakeBake     CakePHP                   Bake                     Bake            5
bakeBake        CakePHP                           Bake                             Bake       --cookbook     --           ...
1.3:                  2.0:cake/console/         lib/Cake/Console/|-- cake              |-- Templates|-- cake.bat          ...
lib/Cake/Console/Templates/skel/       CakePHP-bootstrap-skel/|-- Config                              |-- README.textile|--...
lib/Cake/Console/Templates/default/|-- actions| `-- controller_actions.ctp|-- classes| |-- controller.ctp| |-- fixture.ctp ...
bake                demo  skel                     project bake1.create schema./lib/Cake/Console/cake schema create --file ...
bake     twitter bootstrap                                                skel bake                         <!DOCTYPE html...
default→TwitterBootstrap demoskel/Console/Templates/TwitterBootstrap/|-- actions| `-- controller_actions.ctp|-- classes| |...
search plugin bake→                git clonecd skel/Plugin/git clone git://github.com/cakephp/debug_kit.git -b 2.0 DebugKi...
search plugin bakevi skel/Console/Templates/TwitterBootstrap/actions/controller_actions.ctp  <?php  if ($modelObj) {      ...
search plugin bake  index action  public function <?php echo $admin ?>index() {    $this-><?php echo $currentModelName ?>-...
search plugin bakevi skel/Console/Templates/TwitterBootstrap/classes/model.ctp<?php   $modelObj = ClassRegistry::init($nam...
search plugin bakevi skel/Console/Templates/TwitterBootstrap/classes/model.ctp<?php   $modelObj = ClassRegistry::init($nam...
search plugin bake               index.ctp<div class="span16">     <div class="hero unit">            <?php echo "<?php ec...
search plugin bake                                                                                      demo    bake→bake ...
search plugin bakesearch plugin        debug kit    bake                19
bake                         githubgit://github.com/MontBlanc-Sucks/CakePHP-bootstrap-skel.git                         20
tipshare   !tipshare           21
Upcoming SlideShare
Loading in …5
×

Bake by cake php2.0

3,101 views

Published on

Published in: Technology, Self Improvement
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,101
On SlideShare
0
From Embeds
0
Number of Embeds
18
Actions
Shares
0
Downloads
20
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • &amp;#x7C21;&amp;#x5358;&amp;#x306B;&amp;#x3044;&amp;#x3048;&amp;#x3070;&amp;#x3001;&amp;#x30B9;&amp;#x30AD;&amp;#x30FC;&amp;#x30DE;&amp;#x3092;&amp;#x53C2;&amp;#x7167;&amp;#x3057;&amp;#x3066;MVC&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x51FA;&amp;#x529B;&amp;#x3057;&amp;#x3066;&amp;#x304F;&amp;#x308C;&amp;#x308B;&amp;#x3068;&amp;#x3044;&amp;#x3046;&amp;#x3053;&amp;#x3068;&amp;#x3067;&amp;#x3059;&amp;#x3002;\n
  • \n
  • \n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x3092;&amp;#x8E0F;&amp;#x307E;&amp;#x3048;&amp;#x3066;bake&amp;#x3057;&amp;#x3066;&amp;#x307F;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  • &amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x3092;&amp;#x8E0F;&amp;#x307E;&amp;#x3048;&amp;#x3066;bake&amp;#x3057;&amp;#x3066;&amp;#x307F;&amp;#x307E;&amp;#x3059;&amp;#x3002;\n
  • \n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • &amp;#x305F;&amp;#x3060;&amp;#x3057;&amp;#x7C21;&amp;#x5358;&amp;#x306A;bake&amp;#x306F;&amp;#x3053;&amp;#x308C;&amp;#x3089;&amp;#x306E;&amp;#x30D5;&amp;#x30A1;&amp;#x30A4;&amp;#x30EB;&amp;#x3092;&amp;#x4E3B;&amp;#x306B;&amp;#x7DE8;&amp;#x96C6;&amp;#x3059;&amp;#x308B;\n
  • \n
  • \n
  • Bake by cake php2.0

    1. 1. bake byCakePHP2.0 Bansystems Inc Yosuke Konno 1
    2. 2. 2
    3. 3. yeah! TEAM MontbancSucks ■ 1@konsan @mon_sat ※1: =CakePHP @hiromi2424 3
    4. 4. bake bake bake bake search plugin 4
    5. 5. bakeBake CakePHP Bake Bake 5
    6. 6. bakeBake CakePHP Bake Bake --cookbook -- 5
    7. 7. 1.3: 2.0:cake/console/ lib/Cake/Console/|-- cake |-- Templates|-- cake.bat | |-- default|-- cake.php | `-- skel|-- error.php |-- cake`-- templates |-- cake.bat |-- default `-- cake.php `-- skel 6
    8. 8. lib/Cake/Console/Templates/skel/ CakePHP-bootstrap-skel/|-- Config |-- README.textile|-- Console |-- bootstrap|-- Controller |-- initial|-- Lib | |-- AppSchema.php|-- Locale | `-- data|-- Model `-- skel|-- Plugin |-- Config|-- Test |-- Console|-- Vendor |-- Controller|-- View |-- Lib|-- index.php |-- Locale|-- tmp |-- Model`-- webroot |-- Plugin |-- Test |-- Vendor |-- View |-- index.php |-- tmp `-- webroot 7
    9. 9. lib/Cake/Console/Templates/default/|-- actions| `-- controller_actions.ctp|-- classes| |-- controller.ctp| |-- fixture.ctp bake| |-- model.ctp| `-- test.ctp`-- views |-- form.ctp |-- home.ctp |-- index.ctp `-- view.ctp 8
    10. 10. bake demo skel project bake1.create schema./lib/Cake/Console/cake schema create --file AppSchema.php2.database.php configskel/Config/|-- Schema|-- acl.ini.php|-- bootstrap.php|-- core.php|-- database.php|-- database.php.default|-- email.php.default`-- routes.php 9
    11. 11. bake twitter bootstrap skel bake <!DOCTYPE html> <html> <head> <?php echo $this->Html->charset(); ?> <title>skel/View/Layouts/ <?php echo __(CakePHP: the rapid development php framework:); ?> <?php echo $title_for_layout; ?>|-- Emails </title>|-- default.ctp <meta name="description" content="">|-- js <meta name="author" content=""> <?php|-- rss echo $this->Html->meta(icon);`-- xml echo $this->Html->css(array( http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css, cake.generic, main, )); ?> <script type="text/javascript" src="//www.google.com/jsapi"></script> <script type="text/javascript">google.load("jquery", "1.6.2");</script> <?php echo $this->Html->script(array( 10
    12. 12. default→TwitterBootstrap demoskel/Console/Templates/TwitterBootstrap/|-- actions| `-- controller_actions.ctp|-- classes| |-- controller.ctp| |-- fixture.ctp| |-- model.ctp| `-- test.ctp`-- views |-- form.ctp |-- home.ctp |-- index.ctp `-- view.ctp 11
    13. 13. search plugin bake→ git clonecd skel/Plugin/git clone git://github.com/cakephp/debug_kit.git -b 2.0 DebugKitgit clone git://github.com/CakeDC/search.git -b 2.0 Search※git submodule OK→pluginvi Config/bootstrap.phpCakePlugin::loadAll(); 12
    14. 14. search plugin bakevi skel/Console/Templates/TwitterBootstrap/actions/controller_actions.ctp <?php if ($modelObj) { $schema = $modelObj->schema(true); fields $fields = array_keys($schema); } else { $fields = $schema = $associations = array(); } ?> var $components = array(Search.Prg); var $presetVars = array( <?php foreach ($fields as $field):?> array(model=><?php echo $currentModelName ?>, field => <?phpecho $field?>, type => value), <?php endforeach;?> ); 13
    15. 15. search plugin bake index action public function <?php echo $admin ?>index() { $this-><?php echo $currentModelName ?>->recursive = 0; $this->set(<?php echo $pluralName ?>, $this->paginate()); } public function <?php echo $admin ?>index() { $this->Prg->commonProcess(); $this->paginate = array(conditions=>$this-><?php echo$currentModelName ?>->parseCriteria($this->passedArgs)); $this->set(<?php echo $pluralName ?>, $this->paginate()); } 14
    16. 16. search plugin bakevi skel/Console/Templates/TwitterBootstrap/classes/model.ctp<?php $modelObj = ClassRegistry::init($name); if ($modelObj) { $schema = $modelObj->schema(true); $fields = array_keys($schema); } else { fields $fields = $schema = $associations = array(); }?>/* search plugin*/ public $actsAs = array(Search.Searchable); public $filterArgs = array( <?php foreach ($fields as $field):?> array(name => <?php echo $field?>, type => like), <?php endforeach;?> ); 15
    17. 17. search plugin bakevi skel/Console/Templates/TwitterBootstrap/classes/model.ctp<?php $modelObj = ClassRegistry::init($name); if ($modelObj) { $schema = $modelObj->schema(true); $fields = array_keys($schema); } else { fields $fields = $schema = $associations = array(); }?>/* search plugin*/ public $actsAs = array(Search.Searchable); public $filterArgs = array( <?php foreach ($fields as $field):?> array(name => <?php echo $field?>, type => like), <?php endforeach;?> ); 16
    18. 18. search plugin bake index.ctp<div class="span16"> <div class="hero unit"> <?php echo "<?php echo $this->Form->create({$modelClass}, array(url =>array_merge(array(action => index), $this->params[pass])));?>n"; foreach ($fields as $field) { if (strpos($action, add) !== false && $field == $primaryKey) { continue; } elseif (!in_array($field, array(created, modified, updated, DateInputed,DateUpdated))) { echo "tt <?php echo $this->Form->input({$field});?>n"; } } echo "<?php echo $this->Form->submit(__(Search, true), array(div => false));?>n"; echo "<?php echo $this->Form->end();?>n"; ?> </div></div> 17
    19. 19. search plugin bake demo bake→bake project./lib/Cake/Console/cake bake project app --skel ../CakePHP-bootstrap-skel/skel --empty true→bake all./lib/Cake/Console/cake bake all 18
    20. 20. search plugin bakesearch plugin debug kit bake 19
    21. 21. bake githubgit://github.com/MontBlanc-Sucks/CakePHP-bootstrap-skel.git 20
    22. 22. tipshare !tipshare 21

    ×