SlideShare a Scribd company logo
1 of 22
bake by
CakePHP2.0

   Bansystems Inc
      Yosuke Konno




         1
2
yeah!



          TEAM MontbancSucks
                                           ■
                                                                     1




@konsan                         @mon_sat




                                                   ※1:   =CakePHP

                      @hiromi2424




                                               3
bake


          bake
               bake
       bake   search plugin



                 4
bake

Bake     CakePHP
                   Bake


                     Bake




            5
bake

Bake        CakePHP
                           Bake


                             Bake



       --cookbook     --



                5
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
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
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
bake                demo

  skel                     project bake


1.create schema
./lib/Cake/Console/cake schema create --file AppSchema.php

2.database.php config
skel/Config/
|-- Schema
|-- acl.ini.php
|-- bootstrap.php
|-- core.php
|-- database.php
|-- database.php.default
|-- email.php.default
`-- routes.php

                              9
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
default→TwitterBootstrap demo
skel/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
search plugin bake

→                git clone
cd skel/Plugin/
git clone git://github.com/cakephp/debug_kit.git -b 2.0 DebugKit
git clone git://github.com/CakeDC/search.git -b 2.0 Search
※git submodule                               OK

→plugin
vi Config/bootstrap.php
CakePlugin::loadAll();

                                12
search plugin bake


vi 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' => '<?php
echo $field?>', 'type' => 'value'),
     <?php endforeach;?>
  );
                                         13
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
search plugin bake

vi 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
search plugin bake

vi 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
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
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
search plugin bake




search plugin        debug kit


    bake



                19
bake

                         github

git://github.com/MontBlanc-Sucks/CakePHP-bootstrap-
skel.git




                         20
tipshare   !




tipshare



           21

More Related Content

What's hot

Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Kris Wallsmith
 
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3makoto tsuyuki
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsMark Baker
 
Frameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPFrameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPDan Jesus
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::ManagerJay Shirley
 
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010Plataformatec
 
TDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao BytemanTDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao Bytemantdc-globalcode
 
Your own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyYour own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyLindsay Holmwood
 
Moving from Django Apps to Services
Moving from Django Apps to ServicesMoving from Django Apps to Services
Moving from Django Apps to ServicesCraig Kerstiens
 
Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)Kris Wallsmith
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowVrann Tulika
 
伝説のギタリストじゃない方のDjango
伝説のギタリストじゃない方のDjango伝説のギタリストじゃない方のDjango
伝説のギタリストじゃない方のDjangomakoto tsuyuki
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 

What's hot (20)

Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)Doctrine MongoDB ODM (PDXPHP)
Doctrine MongoDB ODM (PDXPHP)
 
Fatc
FatcFatc
Fatc
 
Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3Django - 次の一歩 gumiStudy#3
Django - 次の一歩 gumiStudy#3
 
A Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP GeneratorsA Functional Guide to Cat Herding with PHP Generators
A Functional Guide to Cat Herding with PHP Generators
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Frameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHPFrameworks da nova Era PHP FuelPHP
Frameworks da nova Era PHP FuelPHP
 
test
testtest
test
 
Building Better Applications with Data::Manager
Building Better Applications with Data::ManagerBuilding Better Applications with Data::Manager
Building Better Applications with Data::Manager
 
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
O que há de novo no Rails 3 - Ruby on Rails no Mundo Real - 23may2010
 
TDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao BytemanTDC2016POA | Trilha Java - Introdução ao Byteman
TDC2016POA | Trilha Java - Introdução ao Byteman
 
Your own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with RubyYour own (little) gem: building an online business with Ruby
Your own (little) gem: building an online business with Ruby
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
 
Django
DjangoDjango
Django
 
Moving from Django Apps to Services
Moving from Django Apps to ServicesMoving from Django Apps to Services
Moving from Django Apps to Services
 
Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)Assetic (Symfony Live Paris)
Assetic (Symfony Live Paris)
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Magento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request FlowMagento Live Australia 2016: Request Flow
Magento Live Australia 2016: Request Flow
 
伝説のギタリストじゃない方のDjango
伝説のギタリストじゃない方のDjango伝説のギタリストじゃない方のDjango
伝説のギタリストじゃない方のDjango
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
CakePHP
CakePHPCakePHP
CakePHP
 

Similar to Bake by cake php2.0

Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applicationschartjes
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Curscatalyst
CurscatalystCurscatalyst
CurscatalystKar Juan
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2markstory
 
Talkaboutlithium
TalkaboutlithiumTalkaboutlithium
Talkaboutlithiumnoppoman722
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastMichelangelo van Dam
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Michelangelo van Dam
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010singingfish
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Michelangelo van Dam
 
10 Catalyst Tips
10 Catalyst Tips10 Catalyst Tips
10 Catalyst TipsJay Shirley
 
Tools and Tips for Moodle Developers - #mootus16
 Tools and Tips for Moodle Developers - #mootus16 Tools and Tips for Moodle Developers - #mootus16
Tools and Tips for Moodle Developers - #mootus16Dan Poltawski
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Michelangelo van Dam
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 

Similar to Bake by cake php2.0 (20)

Building Testable PHP Applications
Building Testable PHP ApplicationsBuilding Testable PHP Applications
Building Testable PHP Applications
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2
 
Talkaboutlithium
TalkaboutlithiumTalkaboutlithium
Talkaboutlithium
 
Workshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfastWorkshop quality assurance for php projects - phpbelfast
Workshop quality assurance for php projects - phpbelfast
 
CakePHP
CakePHPCakePHP
CakePHP
 
Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013Workshop quality assurance for php projects - ZendCon 2013
Workshop quality assurance for php projects - ZendCon 2013
 
Mojolicious
MojoliciousMojolicious
Mojolicious
 
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
Don't RTFM, WTFM - Open Source Documentation - German Perl Workshop 2010
 
My Development Story
My Development StoryMy Development Story
My Development Story
 
Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12Workshop quality assurance for php projects tek12
Workshop quality assurance for php projects tek12
 
10 Catalyst Tips
10 Catalyst Tips10 Catalyst Tips
10 Catalyst Tips
 
Django Vs Rails
Django Vs RailsDjango Vs Rails
Django Vs Rails
 
Tools and Tips for Moodle Developers - #mootus16
 Tools and Tips for Moodle Developers - #mootus16 Tools and Tips for Moodle Developers - #mootus16
Tools and Tips for Moodle Developers - #mootus16
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
SPL, not a bridge too far
SPL, not a bridge too farSPL, not a bridge too far
SPL, not a bridge too far
 
Blog Hacks 2011
Blog Hacks 2011Blog Hacks 2011
Blog Hacks 2011
 
What's new with PHP7
What's new with PHP7What's new with PHP7
What's new with PHP7
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Bake by cake php2.0

  • 1. bake by CakePHP2.0 Bansystems Inc Yosuke Konno 1
  • 2. 2
  • 3. yeah! TEAM MontbancSucks ■ 1 @konsan @mon_sat ※1: =CakePHP @hiromi2424 3
  • 4. bake bake bake bake search plugin 4
  • 5. bake Bake CakePHP Bake Bake 5
  • 6. bake Bake CakePHP Bake Bake --cookbook -- 5
  • 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. 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. 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. bake demo skel project bake 1.create schema ./lib/Cake/Console/cake schema create --file AppSchema.php 2.database.php config skel/Config/ |-- Schema |-- acl.ini.php |-- bootstrap.php |-- core.php |-- database.php |-- database.php.default |-- email.php.default `-- routes.php 9
  • 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. default→TwitterBootstrap demo skel/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. search plugin bake → git clone cd skel/Plugin/ git clone git://github.com/cakephp/debug_kit.git -b 2.0 DebugKit git clone git://github.com/CakeDC/search.git -b 2.0 Search ※git submodule OK →plugin vi Config/bootstrap.php CakePlugin::loadAll(); 12
  • 14. search plugin bake vi 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' => '<?php echo $field?>', 'type' => 'value'), <?php endforeach;?> ); 13
  • 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. search plugin bake vi 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. search plugin bake vi 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. 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. 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. search plugin bake search plugin debug kit bake 19
  • 21. bake github git://github.com/MontBlanc-Sucks/CakePHP-bootstrap- skel.git 20
  • 22. tipshare ! tipshare 21

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. &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
  6. \n
  7. \n
  8. &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
  9. &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
  10. &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
  11. \n
  12. &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
  13. &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
  14. &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
  15. &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
  16. &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
  17. &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
  18. &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
  19. &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
  20. \n
  21. \n