SlideShare a Scribd company logo
CAKE 3Introduction to CakePHP 3
CAKE 3
CakePHP is a web development framework running on PHP 7
(min. PHP 5.5.9).
CakePHP is designed to make common web-development tasks
simple, and easy.
Follow MVC (Model, View, Controller) format
Conventions Over Configuration
Conventions Over Configuration
➤ CakePHP provides a basic organizational structure that covers
class names, filenames, database table names, and other
conventions. CakePHP provides that you can avoid needless
configuration and make a uniform application structure that
makes working with various projects simple.
CONVENTIONS OVER CONFIGURATION
➤ Table names will be plural (e.g., orders)
➤ The name of the primary key field will be id
➤ The names of any foreign key fields will be based on the
referenced table name followed by _id (e.g., the foreign key
into a customers table would be named customer_id).
LATEST IN CAKE3 IS THE NEW ORM !!!
➤ No more array in return.
➤ Cake3 return Entity/Object as return value
➤ Validation removed from Model
➤ Now its separated for reusable or more extensible
➤ Associations No Longer Defined as Properties
In ArticlesTable.php:
class ArticlesTable extends Table {
public function initialize(array $config) {
$this->belongsTo('Users');
}
}
➤ New api function patchEntity, removing not related data from saving
$user = $this->Users->patchEntity($user, $this->request->data);
➤ Cake’s ORM would by default retrieve any associated tables
when performing a query. As a result, a simple “find all” query
could potentially become quite bloated as the underlying SQL
would retrieve all data from all associated tables. In version 3,
this behavior is no longer the default.
use CakeORMTableRegistry;
Controller:
$users = TableRegistry::get(‘Users’);
View:
<?php foreach ($users as $user): ?>
<li class="user">
<?= $this->element('user', ['user' => $user]) ?>
</li>
<?php endforeach; ?>
REQUIREMENTS
➤ CakePHP 3.x supports PHP Version 5.4.16 and above.
➤ CakePHP 3.x requires the mbstring extension.
➤ CakePHP 3.x requires the intl extension.
➤ CakePHP should be installed with Composer
MIGRATION
➤ Upgrade tools for CakePHP meant to facilitate migrating from
CakePHP 2.x to 3.0.0.
Warning This tool is still under development and doesn't handle
all aspects of migrating.
POV: Do not migrate your project from Cake2 to Cake3
Solution: Redesigned the system and Adopt Cake3 standard

More Related Content

What's hot (20)

PDF
REST API with CakePHP
Anuchit Chalothorn
 
PPTX
Php basics
Egerton University
 
PPT
PHP - Getting good with MySQL part II
Firdaus Adib
 
PDF
lab56_db
tutorialsruby
 
PPT
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
webhostingguy
 
PDF
4.3 MySQL + PHP
Jalpesh Vasa
 
PPT
PHP - PDO Objects
AJINKYA N
 
PPT
Php MySql For Beginners
Priti Solanki
 
PDF
Phinx talk
Michael Peacock
 
PPTX
Database Connectivity in PHP
Taha Malampatti
 
PPT
Php with MYSQL Database
Computer Hardware & Trouble shooting
 
PPT
PHP and MySQL
webhostingguy
 
PPTX
Working with WP_Query in WordPress
topher1kenobe
 
PDF
PDO Basics - PHPMelb 2014
andrewdotcom
 
PPTX
An introduction to Laravel Passport
Michael Peacock
 
PDF
Codeigniter : Two Step View - Concept Implementation
Abdul Malik Ikhsan
 
PDF
Codeigniter : Custom Routing - Manipulate Uri
Abdul Malik Ikhsan
 
PDF
Extending the WordPress REST API - Josh Pollock
Caldera Labs
 
PPTX
Message enricher in mule
Sashidhar Rao GDS
 
PPTX
Php Training Workshop by Vtips
Vidya Topa Institute of Professional Studies
 
REST API with CakePHP
Anuchit Chalothorn
 
Php basics
Egerton University
 
PHP - Getting good with MySQL part II
Firdaus Adib
 
lab56_db
tutorialsruby
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
webhostingguy
 
4.3 MySQL + PHP
Jalpesh Vasa
 
PHP - PDO Objects
AJINKYA N
 
Php MySql For Beginners
Priti Solanki
 
Phinx talk
Michael Peacock
 
Database Connectivity in PHP
Taha Malampatti
 
Php with MYSQL Database
Computer Hardware & Trouble shooting
 
PHP and MySQL
webhostingguy
 
Working with WP_Query in WordPress
topher1kenobe
 
PDO Basics - PHPMelb 2014
andrewdotcom
 
An introduction to Laravel Passport
Michael Peacock
 
Codeigniter : Two Step View - Concept Implementation
Abdul Malik Ikhsan
 
Codeigniter : Custom Routing - Manipulate Uri
Abdul Malik Ikhsan
 
Extending the WordPress REST API - Josh Pollock
Caldera Labs
 
Message enricher in mule
Sashidhar Rao GDS
 
Php Training Workshop by Vtips
Vidya Topa Institute of Professional Studies
 

Similar to Cake PHP 3 Presentaion (20)

ODP
Exploring Symfony's Code
Wildan Maulana
 
PPTX
Learn PHP Lacture2
ADARSH BHATT
 
PDF
CakePHP
Walther Lalk
 
PDF
Php summary
Michelle Darling
 
PPT
Synapseindia reviews sharing intro cakephp
SynapseindiaComplaints
 
PPT
Php classes in mumbai
aadi Surve
 
DOC
How to migrate Cakephp 1.x to 2.x
Andolasoft Inc
 
PPT
My sql with querys
NIRMAL FELIX
 
PPT
Bioinformatica 10-11-2011-p6-bioperl
Prof. Wim Van Criekinge
 
PDF
PHP 5.3 Overview
jsmith92
 
ODP
Practical catalyst
dwm042
 
PDF
Ch ch-changes cake php2
markstory
 
PPT
Php frameworks
Anil Kumar Panigrahi
 
PDF
Web applications with Catalyst
svilen.ivanov
 
PDF
From CakePHP to Laravel
Jason McCreary
 
PDF
cake phptutorial
ice27
 
ODP
My sql Syntax
Reka
 
PDF
Doctrine in FLOW3
Karsten Dambekalns
 
Exploring Symfony's Code
Wildan Maulana
 
Learn PHP Lacture2
ADARSH BHATT
 
CakePHP
Walther Lalk
 
Php summary
Michelle Darling
 
Synapseindia reviews sharing intro cakephp
SynapseindiaComplaints
 
Php classes in mumbai
aadi Surve
 
How to migrate Cakephp 1.x to 2.x
Andolasoft Inc
 
My sql with querys
NIRMAL FELIX
 
Bioinformatica 10-11-2011-p6-bioperl
Prof. Wim Van Criekinge
 
PHP 5.3 Overview
jsmith92
 
Practical catalyst
dwm042
 
Ch ch-changes cake php2
markstory
 
Php frameworks
Anil Kumar Panigrahi
 
Web applications with Catalyst
svilen.ivanov
 
From CakePHP to Laravel
Jason McCreary
 
cake phptutorial
ice27
 
My sql Syntax
Reka
 
Doctrine in FLOW3
Karsten Dambekalns
 
Ad

Recently uploaded (20)

PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Ad

Cake PHP 3 Presentaion

  • 2. CAKE 3 CakePHP is a web development framework running on PHP 7 (min. PHP 5.5.9). CakePHP is designed to make common web-development tasks simple, and easy. Follow MVC (Model, View, Controller) format Conventions Over Configuration
  • 3. Conventions Over Configuration ➤ CakePHP provides a basic organizational structure that covers class names, filenames, database table names, and other conventions. CakePHP provides that you can avoid needless configuration and make a uniform application structure that makes working with various projects simple.
  • 4. CONVENTIONS OVER CONFIGURATION ➤ Table names will be plural (e.g., orders) ➤ The name of the primary key field will be id ➤ The names of any foreign key fields will be based on the referenced table name followed by _id (e.g., the foreign key into a customers table would be named customer_id).
  • 5. LATEST IN CAKE3 IS THE NEW ORM !!! ➤ No more array in return. ➤ Cake3 return Entity/Object as return value ➤ Validation removed from Model ➤ Now its separated for reusable or more extensible ➤ Associations No Longer Defined as Properties In ArticlesTable.php: class ArticlesTable extends Table { public function initialize(array $config) { $this->belongsTo('Users'); } } ➤ New api function patchEntity, removing not related data from saving $user = $this->Users->patchEntity($user, $this->request->data);
  • 6. ➤ Cake’s ORM would by default retrieve any associated tables when performing a query. As a result, a simple “find all” query could potentially become quite bloated as the underlying SQL would retrieve all data from all associated tables. In version 3, this behavior is no longer the default.
  • 7. use CakeORMTableRegistry; Controller: $users = TableRegistry::get(‘Users’); View: <?php foreach ($users as $user): ?> <li class="user"> <?= $this->element('user', ['user' => $user]) ?> </li> <?php endforeach; ?>
  • 8. REQUIREMENTS ➤ CakePHP 3.x supports PHP Version 5.4.16 and above. ➤ CakePHP 3.x requires the mbstring extension. ➤ CakePHP 3.x requires the intl extension. ➤ CakePHP should be installed with Composer
  • 9. MIGRATION ➤ Upgrade tools for CakePHP meant to facilitate migrating from CakePHP 2.x to 3.0.0. Warning This tool is still under development and doesn't handle all aspects of migrating. POV: Do not migrate your project from Cake2 to Cake3 Solution: Redesigned the system and Adopt Cake3 standard