SlideShare a Scribd company logo
1 of 9
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

PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
webhostingguy
 

What's hot (20)

REST API with CakePHP
REST API with CakePHPREST API with CakePHP
REST API with CakePHP
 
Php basics
Php basicsPhp basics
Php basics
 
PHP - Getting good with MySQL part II
 PHP - Getting good with MySQL part II PHP - Getting good with MySQL part II
PHP - Getting good with MySQL part II
 
lab56_db
lab56_dblab56_db
lab56_db
 
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...PHP and MySQL PHP Written as a set of CGI binaries in C in ...
PHP and MySQL PHP Written as a set of CGI binaries in C in ...
 
4.3 MySQL + PHP
4.3 MySQL + PHP4.3 MySQL + PHP
4.3 MySQL + PHP
 
PHP - PDO Objects
PHP - PDO ObjectsPHP - PDO Objects
PHP - PDO Objects
 
Php MySql For Beginners
Php MySql For BeginnersPhp MySql For Beginners
Php MySql For Beginners
 
Phinx talk
Phinx talkPhinx talk
Phinx talk
 
Database Connectivity in PHP
Database Connectivity in PHPDatabase Connectivity in PHP
Database Connectivity in PHP
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
PHP and MySQL
PHP and MySQLPHP and MySQL
PHP and MySQL
 
Working with WP_Query in WordPress
Working with WP_Query in WordPressWorking with WP_Query in WordPress
Working with WP_Query in WordPress
 
PDO Basics - PHPMelb 2014
PDO Basics - PHPMelb 2014PDO Basics - PHPMelb 2014
PDO Basics - PHPMelb 2014
 
An introduction to Laravel Passport
An introduction to Laravel PassportAn introduction to Laravel Passport
An introduction to Laravel Passport
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
 
Codeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate UriCodeigniter : Custom Routing - Manipulate Uri
Codeigniter : Custom Routing - Manipulate Uri
 
Extending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh PollockExtending the WordPress REST API - Josh Pollock
Extending the WordPress REST API - Josh Pollock
 
Message enricher in mule
Message enricher in muleMessage enricher in mule
Message enricher in mule
 
Php Training Workshop by Vtips
Php Training Workshop by VtipsPhp Training Workshop by Vtips
Php Training Workshop by Vtips
 

Similar to Cake PHP 3 Presentaion

Learn PHP Lacture2
Learn PHP Lacture2Learn PHP Lacture2
Learn PHP Lacture2
ADARSH BHATT
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
NIRMAL FELIX
 
PHP 5.3 Overview
PHP 5.3 OverviewPHP 5.3 Overview
PHP 5.3 Overview
jsmith92
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
svilen.ivanov
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
Reka
 

Similar to Cake PHP 3 Presentaion (20)

Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Learn PHP Lacture2
Learn PHP Lacture2Learn PHP Lacture2
Learn PHP Lacture2
 
CakePHP
CakePHPCakePHP
CakePHP
 
Php summary
Php summaryPhp summary
Php summary
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephp
 
Php classes in mumbai
Php classes in mumbaiPhp classes in mumbai
Php classes in mumbai
 
How to migrate Cakephp 1.x to 2.x
How to migrate Cakephp 1.x to 2.xHow to migrate Cakephp 1.x to 2.x
How to migrate Cakephp 1.x to 2.x
 
My sql with querys
My sql with querysMy sql with querys
My sql with querys
 
Bioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperlBioinformatica 10-11-2011-p6-bioperl
Bioinformatica 10-11-2011-p6-bioperl
 
PHP 5.3 Overview
PHP 5.3 OverviewPHP 5.3 Overview
PHP 5.3 Overview
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
Ch ch-changes cake php2
Ch ch-changes cake php2Ch ch-changes cake php2
Ch ch-changes cake php2
 
PHP MVC
PHP MVCPHP MVC
PHP MVC
 
Php frameworks
Php frameworksPhp frameworks
Php frameworks
 
Web applications with Catalyst
Web applications with CatalystWeb applications with Catalyst
Web applications with Catalyst
 
From CakePHP to Laravel
From CakePHP to LaravelFrom CakePHP to Laravel
From CakePHP to Laravel
 
cake phptutorial
cake phptutorialcake phptutorial
cake phptutorial
 
My sql Syntax
My sql SyntaxMy sql Syntax
My sql Syntax
 
My sql.ppt
My sql.pptMy sql.ppt
My sql.ppt
 
Doctrine in FLOW3
Doctrine in FLOW3Doctrine in FLOW3
Doctrine in FLOW3
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

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