Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
今こそCakePHP3に乗り換えよう!/php_conference_fukuoka_2016
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
sakuragawa
May 24, 2016
Programming
1.1k
0
Share
今こそCakePHP3に乗り換えよう!/php_conference_fukuoka_2016
今こそCakePHP3に乗り換えよう!
sakuragawa
May 24, 2016
More Decks by sakuragawa
See All by sakuragawa
CircleCI APIでプチ効率化
sakuragawa
1
580
PHP + GitHub + Azure Functions = ?
sakuragawa
0
250
CakePHP2と3の違い
sakuragawa
8
4.9k
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
AgentCore Optimizationを始めよう!
licux
3
240
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
390
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.2k
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.9k
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.5k
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
810
Back to the roots of date
jinroq
0
820
AIを導入する前にやるべきこと
negima
2
350
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Evolving SEO for Evolving Search Engines
ryanjones
0
190
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
550
Making Projects Easy
brettharned
120
6.6k
The Curse of the Amulet
leimatthew05
1
12k
Writing Fast Ruby
sferik
630
63k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.5k
How to build a perfect <img>
jonoalderson
1
5.5k
Between Models and Reality
mayunak
4
290
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
310
Transcript
今こそCakePHP3に乗り換えよう! 2016/5/21
自己紹介 株式会社Fusic 技術開発部 マネージャー 櫻川 幸三 https://github.com/kozo https://github.com/fusic http://qiita.com/kozo http://qiita.com/organizations/fusic
CakePHP利用歴:8年程度(CakePHP1.1から) 2
3 使ってますか?
4 CakePHP3に 移行するメリットあるの?
6 5つのおすすめポイント!
1. QueryBuilder CakePHP2 7 $query = [ ‘conditions’ => [
‘条件A’, ‘条件B’ ], ‘order’ => [ ‘ソート条件A’, ‘ソート条件B’ ], ‘fields’ => [‘取得フィールド’] ] $this->User->find(‘all’, $query); $this->Users->find() ->where(条件A) ->where(条件B) ->order(ソート条件A) ->order(ソート条件B) ->select(取得フィールド) ->all(); • CakePHP3 配列地獄からは解消される!
2. QueryBuilder 8 複雑なSQLもかけるようになった 例) hasMany先のテーブルに条件をかける matching
2. QueryBuilder 9 複雑なSQLもかけるようになった 例) hasMany先のテーブルに条件をかける
3. Table、Entity Table DBのテーブルへアクセスする処理を主に書く CakePHP2のModelクラスに近い動きをする 10 • Entity • DBのテーブル1レコードを表す
• カラムのデータ自体の加工等を担当する • CakePHP2までのModelクラスが、 TableとEntityの2つに分離された Tableクラス Entityクラス
4. HTMLの修正が非常に楽! 11
5. namespace やっとnamespaceに対応した! 12
28 プラグイン
fusic/Apollon 29 Installation composer require fusic/Apollon ひらがな、カタカナ、電話番号といったような基本的なバリデー ションルールをまとめているValidationクラス
fusic/encount 30 本番環境等でwarningやnotice、faital等のエラーが出た場合 にメール等で通知してくれるプラグイン Senderクラスを自作することで通知方法をSlack等、メール以 外に変更することが可能 Installation composer require fusic/encount
kozo/Partial 31 同一コントローラー内で使える小さいスコープのテンプレート Installation composer require kozo/Partial 新規登録画面 編集画面 add.ctp
edit.ctp _form.ctp 共通する部分を 別ファイルにしておき Partialで読み込む
まとめ CakePHP3は 非常にパワフルで拡張性の高い フレームワークになりました。 他にも色々便利な機能があります。 興味ある人は是非、使っていきましょう! 36
ご清聴ありがとうございました Fusicはテクノロジーが 好きなエンジニアを募集しています https://fusic.github.io 37
ご清聴ありがとうございました Fusicはテクノロジーが 好きなエンジニアを募集しています https://fusic.github.io 49