SlideShare ist ein Scribd-Unternehmen logo
1 von 32
CakePHP1.3   CakePHP2.0(beta-)
require CAKE . 'Config' . DS . 'routes.php';
// Router::connect('/:controller', array('action' => 'index'));
// Router::connect('/:controller/:action/*');
public $validate = array(

 'title' => array(

 
 'between' => array(

 
 
 'rule' => array('between', 10, 100),

 
 
 'message' => 'The title must have
between %d to %d characters',

 
 ),

 ),
);
$this->request
    ->data('Post.title', 'New post')
        ->data('Comment.1.author', 'Mark');
CakePlugin::loadAll();



Configure::load('Site'); // load ./Site.php
  Configure::config('default', ...);
# AnyController.php
var $paginate = array(
    'paramType' => 'querystring');
# AnyController.php (default=100)
var $paginate = array('maxLimit' => 10);
# view.ctp
<!--nocache-->
 <?php echo CakeSession::read(‘Auth.user.username’) ?>
<!--/nocache-->
CakeSession::check(‘Auth.user’);



$this->Session->setFlash(); // Controller
$this->Session->flash();     // View
$this->_View->viewVars['foo'] === ‘tipshare’

$this->_View->
    set('title_for_layout', ‘tipshare’);
mb_convert_encoding(
   $this->_View->output, ‘SJIS’, ‘UTF-8’);
$this->Form->postLink(
    ‘delete’, array(‘action’ => ‘delete’));
$this->Form->postButton(
         ‘like’, array(‘action’ => ‘like’));
Cakephp2study tips集
Cakephp2study tips集
Cakephp2study tips集

Weitere ähnliche Inhalte

Was ist angesagt?

Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5Yusuke Wada
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHPmarkstory
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked aboutTatsuhiko Miyagawa
 
State of the CFEngine 2018
State of the CFEngine 2018State of the CFEngine 2018
State of the CFEngine 2018Nick Anderson
 
TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !Matheus Marabesi
 
XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話Takehito Tanabe
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @SilexJeen Lee
 
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravelRazvan Raducanu, PhD
 
exportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxexportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxDaniel Gilhousen
 
GHCソースコード読みのススメ
GHCソースコード読みのススメGHCソースコード読みのススメ
GHCソースコード読みのススメKiwamu Okabe
 
New in cakephp3
New in cakephp3New in cakephp3
New in cakephp3markstory
 
Angular Promises and Advanced Routing
Angular Promises and Advanced RoutingAngular Promises and Advanced Routing
Angular Promises and Advanced RoutingAlexe Bogdan
 

Was ist angesagt? (20)

Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5Twib in Yokoahma.pm 2010/3/5
Twib in Yokoahma.pm 2010/3/5
 
Future of HTTP in CakePHP
Future of HTTP in CakePHPFuture of HTTP in CakePHP
Future of HTTP in CakePHP
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
State of the CFEngine 2018
State of the CFEngine 2018State of the CFEngine 2018
State of the CFEngine 2018
 
TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !TDC2015 Porto Alegre - Automate everything with Phing !
TDC2015 Porto Alegre - Automate everything with Phing !
 
XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話XamarinとAWSをつないでみた話
XamarinとAWSをつないでみた話
 
fabfile.py
fabfile.pyfabfile.py
fabfile.py
 
Getting Started-with-Laravel
Getting Started-with-LaravelGetting Started-with-Laravel
Getting Started-with-Laravel
 
Smolder @Silex
Smolder @SilexSmolder @Silex
Smolder @Silex
 
Laravel the right way
Laravel   the right wayLaravel   the right way
Laravel the right way
 
7. Lower upper in Laravel
7. Lower upper in Laravel7. Lower upper in Laravel
7. Lower upper in Laravel
 
16.mysql stored procedures in laravel
16.mysql stored procedures in laravel16.mysql stored procedures in laravel
16.mysql stored procedures in laravel
 
exportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxexportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailbox
 
Blog Hacks 2011
Blog Hacks 2011Blog Hacks 2011
Blog Hacks 2011
 
GHCソースコード読みのススメ
GHCソースコード読みのススメGHCソースコード読みのススメ
GHCソースコード読みのススメ
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
New in cakephp3
New in cakephp3New in cakephp3
New in cakephp3
 
Angular Promises and Advanced Routing
Angular Promises and Advanced RoutingAngular Promises and Advanced Routing
Angular Promises and Advanced Routing
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
PHP 8.1: Enums
PHP 8.1: EnumsPHP 8.1: Enums
PHP 8.1: Enums
 

Andere mochten auch

Study shimbashi 201102
Study shimbashi 201102Study shimbashi 201102
Study shimbashi 201102Kohji Tanaka
 
Hipaa training
Hipaa trainingHipaa training
Hipaa trainingmussell
 
PHP Matsuri 2013 mon_sat
PHP Matsuri 2013 mon_satPHP Matsuri 2013 mon_sat
PHP Matsuri 2013 mon_satKohji Tanaka
 
テーマは『○○』勉強会
テーマは『○○』勉強会テーマは『○○』勉強会
テーマは『○○』勉強会Kohji Tanaka
 
Immigration Workshop
Immigration  WorkshopImmigration  Workshop
Immigration Workshopdorsetcollege
 

Andere mochten auch (8)

Study shimbashi 201102
Study shimbashi 201102Study shimbashi 201102
Study shimbashi 201102
 
Hipaa training
Hipaa trainingHipaa training
Hipaa training
 
PAPELES
PAPELESPAPELES
PAPELES
 
PHP Matsuri 2013 mon_sat
PHP Matsuri 2013 mon_satPHP Matsuri 2013 mon_sat
PHP Matsuri 2013 mon_sat
 
テーマは『○○』勉強会
テーマは『○○』勉強会テーマは『○○』勉強会
テーマは『○○』勉強会
 
Immigration Workshop
Immigration  WorkshopImmigration  Workshop
Immigration Workshop
 
Phpmatsuri2011LT
Phpmatsuri2011LTPhpmatsuri2011LT
Phpmatsuri2011LT
 
about facebook
about facebookabout facebook
about facebook
 

Ähnlich wie Cakephp2study tips集

The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of LithiumNate Abele
 
Oracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesOracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesKim Berg Hansen
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012D
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Elena Kolevska
 
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsPhpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsMichael Peacock
 
Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the frameworkGOG.com dev team
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ioSteven Beeckman
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web developmentJohannes Brodwall
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHPHari K T
 
Spring data iii
Spring data iiiSpring data iii
Spring data iii명철 강
 
Part APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docxPart APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docxdewhirstichabod
 
Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...
Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...
Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...dantleech
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Zianed Hou
 
Filesystem abstractions and msg queue sergeev - symfony camp 2018
Filesystem abstractions and msg queue   sergeev - symfony camp 2018Filesystem abstractions and msg queue   sergeev - symfony camp 2018
Filesystem abstractions and msg queue sergeev - symfony camp 2018Юлия Коваленко
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsFrancois Zaninotto
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2markstory
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11Michelangelo van Dam
 

Ähnlich wie Cakephp2study tips集 (20)

The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
Oracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web ServicesOracle database - Get external data via HTTP, FTP and Web Services
Oracle database - Get external data via HTTP, FTP and Web Services
 
What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012What mom never told you about bundle configurations - Symfony Live Paris 2012
What mom never told you about bundle configurations - Symfony Live Paris 2012
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
 
Phpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friendsPhpne august-2012-symfony-components-friends
Phpne august-2012-symfony-components-friends
 
Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the framework
 
node.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.ionode.js and the AR.Drone: building a real-time dashboard using socket.io
node.js and the AR.Drone: building a real-time dashboard using socket.io
 
Bare-knuckle web development
Bare-knuckle web developmentBare-knuckle web development
Bare-knuckle web development
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 
Spring data iii
Spring data iiiSpring data iii
Spring data iii
 
Twitter codeigniter library
Twitter codeigniter libraryTwitter codeigniter library
Twitter codeigniter library
 
Part APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docxPart APurposeThis laboratory provides some experience work.docx
Part APurposeThis laboratory provides some experience work.docx
 
Silex Cheat Sheet
Silex Cheat SheetSilex Cheat Sheet
Silex Cheat Sheet
 
Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...
Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...
Building and Incredible Machine with Pipelines and Generators in PHP (IPC Ber...
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1Tomcat连接池配置方法V2.1
Tomcat连接池配置方法V2.1
 
Filesystem abstractions and msg queue sergeev - symfony camp 2018
Filesystem abstractions and msg queue   sergeev - symfony camp 2018Filesystem abstractions and msg queue   sergeev - symfony camp 2018
Filesystem abstractions and msg queue sergeev - symfony camp 2018
 
Bonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node jsBonnes pratiques de développement avec Node js
Bonnes pratiques de développement avec Node js
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2
 
Unit testing with zend framework tek11
Unit testing with zend framework tek11Unit testing with zend framework tek11
Unit testing with zend framework tek11
 

Mehr von Kohji Tanaka

ビジネスを加速させる議事録作成
ビジネスを加速させる議事録作成ビジネスを加速させる議事録作成
ビジネスを加速させる議事録作成Kohji Tanaka
 
Cakephp2.1 ViewBlock view-inheritance
Cakephp2.1 ViewBlock view-inheritanceCakephp2.1 ViewBlock view-inheritance
Cakephp2.1 ViewBlock view-inheritanceKohji Tanaka
 
FW初心者勉強会 in 恵比寿
FW初心者勉強会 in 恵比寿FW初心者勉強会 in 恵比寿
FW初心者勉強会 in 恵比寿Kohji Tanaka
 
そしてクラウドへ
そしてクラウドへそしてクラウドへ
そしてクラウドへKohji Tanaka
 
cakephp2.0で初めてのテスト
cakephp2.0で初めてのテストcakephp2.0で初めてのテスト
cakephp2.0で初めてのテストKohji Tanaka
 
パスワード管理
パスワード管理パスワード管理
パスワード管理Kohji Tanaka
 
PM理論を活用した管理者育成
PM理論を活用した管理者育成PM理論を活用した管理者育成
PM理論を活用した管理者育成Kohji Tanaka
 
Iteigo develop anywhere
Iteigo develop anywhereIteigo develop anywhere
Iteigo develop anywhereKohji Tanaka
 

Mehr von Kohji Tanaka (13)

PM理論
PM理論PM理論
PM理論
 
Touch typing
Touch typingTouch typing
Touch typing
 
ビジネスを加速させる議事録作成
ビジネスを加速させる議事録作成ビジネスを加速させる議事録作成
ビジネスを加速させる議事録作成
 
Cakephp2.1 ViewBlock view-inheritance
Cakephp2.1 ViewBlock view-inheritanceCakephp2.1 ViewBlock view-inheritance
Cakephp2.1 ViewBlock view-inheritance
 
FW初心者勉強会 in 恵比寿
FW初心者勉強会 in 恵比寿FW初心者勉強会 in 恵比寿
FW初心者勉強会 in 恵比寿
 
そしてクラウドへ
そしてクラウドへそしてクラウドへ
そしてクラウドへ
 
web service
web serviceweb service
web service
 
Cakephp4d 201107
Cakephp4d 201107Cakephp4d 201107
Cakephp4d 201107
 
cakephp2.0で初めてのテスト
cakephp2.0で初めてのテストcakephp2.0で初めてのテスト
cakephp2.0で初めてのテスト
 
パスワード管理
パスワード管理パスワード管理
パスワード管理
 
PM理論を活用した管理者育成
PM理論を活用した管理者育成PM理論を活用した管理者育成
PM理論を活用した管理者育成
 
Iteigo develop anywhere
Iteigo develop anywhereIteigo develop anywhere
Iteigo develop anywhere
 
Study smartphone
Study smartphoneStudy smartphone
Study smartphone
 

Cakephp2study tips集

Hinweis der Redaktion

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n