Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
今こそCakePHP3に乗り換えよう!/php_conference_fukuoka_2016
Search
sakuragawa
May 24, 2016
Programming
1.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
今こそCakePHP3に乗り換えよう!/php_conference_fukuoka_2016
今こそCakePHP3に乗り換えよう!
sakuragawa
May 24, 2016
More Decks by sakuragawa
See All by sakuragawa
CircleCI APIでプチ効率化
sakuragawa
1
600
PHP + GitHub + Azure Functions = ?
sakuragawa
0
270
CakePHP2と3の違い
sakuragawa
8
4.9k
Other Decks in Programming
See All in Programming
Heart of Swift Concurrency
koher
0
1.2k
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
140
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
4k
パーソナライズPodcastを作った話
repunit11
0
120
The Rails Doctrine Decade
koic
2
510
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
920
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
110
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
130
速習iPhone Duo対応
yuukiw00w
2
960
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.5k
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
350
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
550
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
260
Building the Perfect Custom Keyboard
takai
2
890
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
350
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
450
Leo the Paperboy
mayatellez
10
2.4k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.1k
KATA
mclloyd
PRO
35
16k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Paper Plane
katiecoart
PRO
4
54k
The Limits of Empathy - UXLibs8
cassininazir
1
710
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