Soumettre la recherche
Mettre en ligne
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
•
2 j'aime
•
2,036 vues
Masahiro Akita
Suivre
http://www.akiyan.com/
Lire moins
Lire la suite
Technologie
Formation
Signaler
Partager
Signaler
Partager
1 sur 115
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
Jqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
Array operators
Array operators
RamakrishnaChava5
Data::FormValidator Simplified
Data::FormValidator Simplified
Fred Moyer
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JSFestUA
Miniproject on Employee Management using Perl/Database.
Miniproject on Employee Management using Perl/Database.
Sanchit Raut
Django Environment
Django Environment
Loren Davie
Manage catalog Configueation In Sharepoint PowerShell
Manage catalog Configueation In Sharepoint PowerShell
Chitexe Marcos Maniche
Magento Dependency Injection
Magento Dependency Injection
Anton Kril
Recommandé
Jqeury ajax plugins
Jqeury ajax plugins
Inbal Geffen
Array operators
Array operators
RamakrishnaChava5
Data::FormValidator Simplified
Data::FormValidator Simplified
Fred Moyer
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JS Fest 2019. Glenn Reyes. With great power comes great React hooks!
JSFestUA
Miniproject on Employee Management using Perl/Database.
Miniproject on Employee Management using Perl/Database.
Sanchit Raut
Django Environment
Django Environment
Loren Davie
Manage catalog Configueation In Sharepoint PowerShell
Manage catalog Configueation In Sharepoint PowerShell
Chitexe Marcos Maniche
Magento Dependency Injection
Magento Dependency Injection
Anton Kril
Keeping It Simple
Keeping It Simple
Stephanie Leary
Moodle Quick Forms
Moodle Quick Forms
Jalpa Bhavsar
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
Matthew McCullough
WordPress 3.1 at DC PHP
WordPress 3.1 at DC PHP
andrewnacin
WordPress Capabilities Magic
WordPress Capabilities Magic
mannieschumpert
Stay with React.js in 2020
Stay with React.js in 2020
Jerry Liao
JavaOne 2017 | JShell: The Ultimate Missing Tool
JavaOne 2017 | JShell: The Ultimate Missing Tool
Hakan Özler
Ex[1].3 php db connectivity
Ex[1].3 php db connectivity
Mouli Chandira
PHPUnit でよりよくテストを書くために
PHPUnit でよりよくテストを書くために
Yuya Takeyama
Eden Hackathon Benilde (Mysql & SMTP)
Eden Hackathon Benilde (Mysql & SMTP)
Dan Michael Molina
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
allilevine
Php update and delet operation
Php update and delet operation
syeda zoya mehdi
Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
Rebecca Murphey
PHPUnit with Mocking and Crawling
PHPUnit with Mocking and Crawling
Trung x
J querypractice
J querypractice
Inbal Geffen
Delivering a Responsive UI
Delivering a Responsive UI
Rebecca Murphey
Bacbkone js
Bacbkone js
Артём Курапов
Building secured wordpress themes and plugins
Building secured wordpress themes and plugins
Tikaram Bhandari
Theming Drupal 7 - Meet your new best friend, render()
Theming Drupal 7 - Meet your new best friend, render()
Erik Baldwin
#wpbar 26/3 - Förenkla WP-admin
#wpbar 26/3 - Förenkla WP-admin
Olaf Lindström
究極のコントローラを目指す
究極のコントローラを目指す
Yasuo Harada
PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)
Win Yu
Contenu connexe
Tendances
Keeping It Simple
Keeping It Simple
Stephanie Leary
Moodle Quick Forms
Moodle Quick Forms
Jalpa Bhavsar
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
Matthew McCullough
WordPress 3.1 at DC PHP
WordPress 3.1 at DC PHP
andrewnacin
WordPress Capabilities Magic
WordPress Capabilities Magic
mannieschumpert
Stay with React.js in 2020
Stay with React.js in 2020
Jerry Liao
JavaOne 2017 | JShell: The Ultimate Missing Tool
JavaOne 2017 | JShell: The Ultimate Missing Tool
Hakan Özler
Ex[1].3 php db connectivity
Ex[1].3 php db connectivity
Mouli Chandira
PHPUnit でよりよくテストを書くために
PHPUnit でよりよくテストを書くために
Yuya Takeyama
Eden Hackathon Benilde (Mysql & SMTP)
Eden Hackathon Benilde (Mysql & SMTP)
Dan Michael Molina
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
allilevine
Php update and delet operation
Php update and delet operation
syeda zoya mehdi
Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
Rebecca Murphey
PHPUnit with Mocking and Crawling
PHPUnit with Mocking and Crawling
Trung x
J querypractice
J querypractice
Inbal Geffen
Delivering a Responsive UI
Delivering a Responsive UI
Rebecca Murphey
Bacbkone js
Bacbkone js
Артём Курапов
Building secured wordpress themes and plugins
Building secured wordpress themes and plugins
Tikaram Bhandari
Theming Drupal 7 - Meet your new best friend, render()
Theming Drupal 7 - Meet your new best friend, render()
Erik Baldwin
#wpbar 26/3 - Förenkla WP-admin
#wpbar 26/3 - Förenkla WP-admin
Olaf Lindström
Tendances
(20)
Keeping It Simple
Keeping It Simple
Moodle Quick Forms
Moodle Quick Forms
DOSUG Intro to JQuery JavaScript Framework
DOSUG Intro to JQuery JavaScript Framework
WordPress 3.1 at DC PHP
WordPress 3.1 at DC PHP
WordPress Capabilities Magic
WordPress Capabilities Magic
Stay with React.js in 2020
Stay with React.js in 2020
JavaOne 2017 | JShell: The Ultimate Missing Tool
JavaOne 2017 | JShell: The Ultimate Missing Tool
Ex[1].3 php db connectivity
Ex[1].3 php db connectivity
PHPUnit でよりよくテストを書くために
PHPUnit でよりよくテストを書くために
Eden Hackathon Benilde (Mysql & SMTP)
Eden Hackathon Benilde (Mysql & SMTP)
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
WordCamp Montreal 2015: Combining Custom Post Types, Fields, and Meta Boxes t...
Php update and delet operation
Php update and delet operation
Beyond the DOM: Sane Structure for JS Apps
Beyond the DOM: Sane Structure for JS Apps
PHPUnit with Mocking and Crawling
PHPUnit with Mocking and Crawling
J querypractice
J querypractice
Delivering a Responsive UI
Delivering a Responsive UI
Bacbkone js
Bacbkone js
Building secured wordpress themes and plugins
Building secured wordpress themes and plugins
Theming Drupal 7 - Meet your new best friend, render()
Theming Drupal 7 - Meet your new best friend, render()
#wpbar 26/3 - Förenkla WP-admin
#wpbar 26/3 - Förenkla WP-admin
Similaire à CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
究極のコントローラを目指す
究極のコントローラを目指す
Yasuo Harada
PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)
Win Yu
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
Rafael Dohms
Silex meets SOAP & REST
Silex meets SOAP & REST
Hugo Hamon
Advanced php testing in action
Advanced php testing in action
Jace Ju
Min-Maxing Software Costs
Min-Maxing Software Costs
Konstantin Kudryashov
Unit testing with zend framework tek11
Unit testing with zend framework tek11
Michelangelo van Dam
Bag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Marcus Ramberg
Drupal Development (Part 2)
Drupal Development (Part 2)
Jeff Eaton
Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnit
mfrost503
PHP Unit Testing
PHP Unit Testing
Tagged Social
Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnit
mfrost503
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
Michelangelo van Dam
Code moi une RH! (PHP tour 2017)
Code moi une RH! (PHP tour 2017)
Arnaud Langlade
Unit testing zend framework apps
Unit testing zend framework apps
Michelangelo van Dam
Modern JavaScript Engine Performance
Modern JavaScript Engine Performance
Catalin Dumitru
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
jhchabran
Daily notes
Daily notes
meghendra168
laravel tricks in 50minutes
laravel tricks in 50minutes
Barang CK
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes
Azim Kurt
Similaire à CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
(20)
究極のコントローラを目指す
究極のコントローラを目指す
PHP 良好實踐 (Best Practice)
PHP 良好實踐 (Best Practice)
Your code sucks, let's fix it - DPC UnCon
Your code sucks, let's fix it - DPC UnCon
Silex meets SOAP & REST
Silex meets SOAP & REST
Advanced php testing in action
Advanced php testing in action
Min-Maxing Software Costs
Min-Maxing Software Costs
Unit testing with zend framework tek11
Unit testing with zend framework tek11
Bag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
Drupal Development (Part 2)
Drupal Development (Part 2)
Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnit
PHP Unit Testing
PHP Unit Testing
Mocking Dependencies in PHPUnit
Mocking Dependencies in PHPUnit
Unit testing with zend framework PHPBenelux
Unit testing with zend framework PHPBenelux
Code moi une RH! (PHP tour 2017)
Code moi une RH! (PHP tour 2017)
Unit testing zend framework apps
Unit testing zend framework apps
Modern JavaScript Engine Performance
Modern JavaScript Engine Performance
Introduction à CoffeeScript pour ParisRB
Introduction à CoffeeScript pour ParisRB
Daily notes
Daily notes
laravel tricks in 50minutes
laravel tricks in 50minutes
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes
Dernier
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
Kalema Edgar
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
Alan Dix
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
NavinnSomaal
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Mark Simos
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
DianaGray10
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
BookNet Canada
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Pixlogix Infotech
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
Dilum Bandara
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
LoriGlavin3
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Alex Barbosa Coqueiro
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
Raghuram Pandurangan
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
LoriGlavin3
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
BookNet Canada
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
Slibray Presentation
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
Curtis Poe
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
gvaughan
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
LoriGlavin3
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
Addepto
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
Lars Bell
Dernier
(20)
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
CakePHPをさらにDRYにする、ドライケーキレシピ akiyan.com 秋田真宏
1.
2.
3.
4.
5.
6.
7.
8.
(
)
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
$this->User->findAll( array(
‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, ) )
26.
27.
$this->User->findAll( ”
status = ‘active’ AND confirmed_email = ‘YES’ ” )
28.
29.
30.
31.
32.
33.
34.
Don’t Repeat Yourself
35.
36.
37.
38.
39.
40.
Class User extends
AppModel { var $name = ‘User’; function getActiveUser() { return $this->User->findAll(array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, )); } } $this->User->getActiveUser();
41.
42.
43.
44.
Class User extends
AppModel { var $name = ‘User’; function getActiveUser($limit = null, $page = null) { return $this->User->findAll(array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, ), null, null, $limit, $page); } }
45.
46.
47.
Class User extends
AppModel { var $name = ‘User’; function getActiveUser($order = null, $limit = null, $page = null) { return $this->User->findAll(array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, ), null, $order, $limit, $page); } }
48.
…
49.
…
50.
51.
52.
53.
54.
55.
Class User extends
AppModel { var $name = ‘User’; var $cond_activeuser = array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, }; } $this->User->findAll($this->User->cond_activeuser);
56.
57.
58.
59.
60.
61.
62.
63.
// $this->User->findAll(
am( $this->User->cond_activeuser, array(‘sex’ => ‘male’) ) );
64.
65.
// $this->User->findAll(
am( $this->User->cond_activeuser, array(‘sex’ => ‘male’) ) );
66.
// $this->User->findAll(
am( $this->User->cond_activeuser, array(‘sex’ => ‘male’) ) ); ‘ ’ ‘ ’
67.
// Array( [status]
=> active [confirmed_email] => yes [sex] => male )
68.
69.
70.
71.
72.
73.
Class User extends
AppModel { var $name = ‘User’; var $cond_activeuser = array( ‘or’ => array( array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, ), array( ‘status’ => ‘active’, ‘confirmed_phone’ => ‘yes’, ), ), ); }
74.
75.
Array ( [or]
=> Array ( [0] => Array ( [status] => active [confirmed_email] => yes ) [1] => Array ( [status] => active [confirmed_phone] => yes ) ) )
76.
77.
78.
79.
80.
array_merge_recursive($this->User->cond_activeuser, array(
'or' => array( array('sex' => 'male'), ) ) )
81.
結果
82.
Array ( [or]
=> Array ( [0] => Array ( [status] => active [confirmed_email] => yes ) [1] => Array ( [status] => active [confirmed_phone] => yes ) [2] => Array ( [sex] => male ) ) )
83.
84.
85.
$cond = $this->User->cond_activeuser; $cond[‘or’][0][‘sex’]
= ‘male’; $cond[‘or’][1][‘sex’] = ‘male’;
86.
87.
88.
89.
90.
91.
92.
93.
94.
Class User extends
AppModel { var $name = ‘User’; function getActiveCond($merger) { return am(array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, ), $merger); } }
95.
$this->User->getActiveCond(array(‘sex’ => ‘male’)); Array(
[status] => active [confirmed_email] => yes [sex] => male )
96.
97.
98.
99.
Class User extends
AppModel { var $name = ‘User’; function getActiveCond($merger) { return array( ‘or’ => array( am(array( ‘status’ => ‘active’, ‘confirmed_email’ => ‘yes’, ), $merger), am(array( ‘status’ => ‘active’, ‘confirmed_phone’ => ‘yes’, ), $merger), ), ); } }
100.
101.
$this->User->getActiveCond(array(‘sex’ => ‘male’)); Array (
[or] => Array ( [0] => Array ( [status] => active [confirmed_email] => yes [sex] => male ) [1] => Array ( [status] => active [confirmed_phone] => yes [sex] => male ) ) )
102.
103.
104.
105.
106.
107.
108.
← 銀座 洋菓子舗
ウエストに Dry cake というケーキがあるらしい http://www.ginza-west.co.jp/
109.
110.
111.
112.
…
Télécharger maintenant