SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
www.edureka.co/php-mysql
View PHP & MySQL with MVC Frameworks course details at www.edureka.co/php-mysql
For Queries:
Post on Twitter @edurekaIN: #askEdureka
Post on Facebook /edurekaIN
For more details please contact us:
US : 1800 275 9730 (toll free)
INDIA : +91 88808 62004
Email us : webinar@edureka.co
Building Restful Web App Rapidly in CakePHP
Slide 2 www.edureka.co/php-mysqlSlide 2
Objectives
At the end of this module, you will be able to understand:
MVC Architecture
CakePHP Introduction
Why to Use CakePHP
How to Configure CakePHP
Creating a Simple Web Application Using CakePHP
Slide 3 www.edureka.co/php-mysqlSlide 3
 Coding in straight PHP can lead to spaghetti code. Long lines of code that have multiple interactions and typically
have HTML code in it
 Leads to disorganization
 Difficult to re-use code
 Change one thing, break another
 Everything must be tested, which is difficult
 Hard code everything from scratch
 Teamwork challenges - parallel programming cannot be done efficiently
Drawbacks of Designing an Application Without Using a Framework
Design Patterns is a way to organize a program in a proper manner
One such design pattern is MVC
Slide 4 www.edureka.co/php-mysql
Introduction – What is MVC
MVC Introduction
 MVC is acronym for Model-View-Controller
 MVC is software design pattern for developing web and desktop applications
 It separates the application logic in easily manageable containers viz Model, View and
Controller
Slide 5 www.edureka.co/php-mysql
MVC Introduction - Model
 The Model container manages the data and business logic of the application
 Model receives requests for data access from View
 It also receives requests from Controller to update the data
 Model encapsulates the database and file access from rest of the application logic
Model
Slide 6 www.edureka.co/php-mysql
MVC Introduction - View
 The View container manages the presentation of data in specific format
 Each model can have multiple views associated with it
 View handles all the user interface elements e.g. forms, tables, formatted data
 View also implements templates to unify the overall look and feel of the website
View
Slide 7 www.edureka.co/php-mysql
MVC Introduction - Controller
 The Controller container manages all the communication between Model and view
 Controller is the entry point of all the requests made in the web application
 Controller responds to the events, communicate with model and sets data for view
 Controller can be considered as brain of the application
Controller
Slide 8 www.edureka.co/php-mysql
MVC Introduction - Illustration
Web
Browser/Client
HTTP Request
HTTP Response
CONTROLLER MODEL
VIEW
Data object
Request
Data Objects
Response
Render dataEvents
(GET/POST)
Handled by Framework
(Hidden from user)
Database
Database
Request
Raw Data
Response
MVC Container
Website User
http://www.mywebsite.com
Slide 9 www.edureka.co/php-mysql
CakePHP - Introduction
What is CakePHP?
 It is free, open source, rapid development framework for PHP
 Follows and implements MVC architecture
 Provides a basic structure for organizing files and database table names - keeping everything consistent and
logical.
 Other available frameworks are Zend framework, CodeIgniter, Laravel etc.
Slide 10 www.edureka.co/php-mysql
CakePHP - Introduction
Why CakePHP?
 Open source with flexible licensing
 Supports MVC architecture
 Easy to install with minimal configuration, faster to learn
 Powerful in-build form validation using models
 CakeBake to generate ready to use code
 Integrated CRUD for database interaction
 View helpers for AJAX, JavaScript, HTML forms and more
 Email, cookie, security, session, and request handling Components
Slide 11 www.edureka.co/php-mysqlSlide 11Slide 11Slide 11
Cake PHP Features
Code generation and scaffolding
 Scaffolding is a programming technique
popularized by Ruby on Rails where
code is generated for basic DB
operations
Easy configuration
 Two changes to a file, generate
database config
Out-of-the-box functionality
 DB Support, Form creation , validation
Users, authentication
Community
 Strong, Active
 Maintained Plugins
Clean MVC Implementation
 Industry standard design pattern
 Structured application
 Easy for developers to read
Cake PHP for a long time from 2005
 Broad user base
 Available documentation
Slide 12 www.edureka.co/php-mysql
CakePHP - Prerequisite
Prerequisite for CakePHP 2.5.6
 Apache httpd server 2.4
 PHP 5.2.8 or higher
 MySQL 4 or higher
 We are assuming that we already have PHP and MySQL setup running on the
machine
Slide 13 www.edureka.co/php-mysql
Configuring CakePHP (Contd…)
 Download the CakePHP version 2.5.6 zip file from
https://github.com/cakephp/cakephp/archive/2.5.6.zip
 Extract the zip file to the apache webserver document root directory
To get the document root directory location –
» Browse to Apache 2.4 directory
» Click on conf folder and edit the httpd.conf file
» Find the word “DocumentRoot”. It will have the document root directory path.
Slide 14 www.edureka.co/php-mysql
Configuring CakePHP (Contd…)
Document root
Slide 15 www.edureka.co/php-mysql
Configuring CakePHP (Contd…)
 Now Start the apache and MySQL server if it is not already running.
 Open web browser and enter http://localhost/cakephp-2.5.6/
 Browser will show the CakePHP index page. This means your CakePHP has been setup correctly.
 There are some warnings displayed in the index page. We will resolve them in post installation steps next.
Slide 16 www.edureka.co/php-mysql
Configuring CakePHP (Contd…)
Check the installation - Output
Slide 17 www.edureka.co/php-mysql
CakePHP folder structure
CakePHP core directories
 There are 4 core directories under CakePHP
 app, lib, plugins and vendors
Slide 18 www.edureka.co/php-mysql
CakePHP folder structure
CakePHP core directories
 app
» Main working directory for CakePHP development
» Contains all custom application code including model, view and controller.
» Also contains public webroot directory (document root)
 lib
» Contains all the core CakePHP libraries
» DO NOT modify any files in this directory as it will affect the core CakePHP functionality
 plugins
» Empty by default
» Can contain custom plugins made available to enhance CakePHP functionality
 vendors
» Empty by default
» Can contains third party libraries
Slide 19 www.edureka.co/php-mysql
Creating a Simple Web Application Using CakePHP
A Web application to display all the user details with an option to add a new user, edit an existing user and to delete a
user using CakePHP
Application to perform simple CRUD (Create, Read, Update and Delete) operations
Create a Database with name 'Edureka'
mysql> create database Edureka
Create a Database Table with name "users" in "Edureka" Database with the following fields
ID
FIRST_NAME
LAST_NAME
EMAIL
MOBILE
User Management System
Slide 20 www.edureka.co/php-mysql
Questions
Slide 21 www.edureka.co/php-mysql

Mais conteúdo relacionado

Mais procurados

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBEdureka!
 
Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)let's go to study
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCBilal Amjad
 
Customer FX Technical Reference Sheet
Customer FX Technical Reference SheetCustomer FX Technical Reference Sheet
Customer FX Technical Reference SheetGoodCustomers
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTDr. Awase Khirni Syed
 
CakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledCakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledLuís Fred
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web ApplicationSachin Walvekar
 
How To Install Magento 2 (updated for the latest version)
How To Install Magento 2 (updated for the latest version)How To Install Magento 2 (updated for the latest version)
How To Install Magento 2 (updated for the latest version)Magestore
 
Meet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoMeet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoAmasty
 
Shalik patel report myfacebook
Shalik patel report myfacebookShalik patel report myfacebook
Shalik patel report myfacebookShalikram Patel
 
Mule with salesforce push topic notification copy
Mule with salesforce push topic notification   copyMule with salesforce push topic notification   copy
Mule with salesforce push topic notification copySanjeet Pandey
 
10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)Mandar Majmudar
 
Mobile for Enterprise
Mobile for EnterpriseMobile for Enterprise
Mobile for EnterpriseNUS-ISS
 

Mais procurados (19)

Web forms in ASP.net
Web forms in ASP.netWeb forms in ASP.net
Web forms in ASP.net
 
Asp.Net Tutorials
Asp.Net TutorialsAsp.Net Tutorials
Asp.Net Tutorials
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)Chapter 1 (asp.net over view)
Chapter 1 (asp.net over view)
 
ASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVCASP.NET - Introduction to Web Forms and MVC
ASP.NET - Introduction to Web Forms and MVC
 
Php On Windows
Php On WindowsPhp On Windows
Php On Windows
 
Customer FX Technical Reference Sheet
Customer FX Technical Reference SheetCustomer FX Technical Reference Sheet
Customer FX Technical Reference Sheet
 
C# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENTC# ASP.NET WEB API APPLICATION DEVELOPMENT
C# ASP.NET WEB API APPLICATION DEVELOPMENT
 
CakePHP - Admin Acl Controlled
CakePHP - Admin Acl ControlledCakePHP - Admin Acl Controlled
CakePHP - Admin Acl Controlled
 
Making Of PHP Based Web Application
Making Of PHP Based Web ApplicationMaking Of PHP Based Web Application
Making Of PHP Based Web Application
 
How To Install Magento 2 (updated for the latest version)
How To Install Magento 2 (updated for the latest version)How To Install Magento 2 (updated for the latest version)
How To Install Magento 2 (updated for the latest version)
 
Meet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey IvashchenkoMeet Magento Belarus - Sergey Ivashchenko
Meet Magento Belarus - Sergey Ivashchenko
 
Shalik patel report myfacebook
Shalik patel report myfacebookShalik patel report myfacebook
Shalik patel report myfacebook
 
Mule with salesforce push topic notification copy
Mule with salesforce push topic notification   copyMule with salesforce push topic notification   copy
Mule with salesforce push topic notification copy
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
Mule with facebook
Mule with facebookMule with facebook
Mule with facebook
 
10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)10 top web development frameworks (new version 21 11)
10 top web development frameworks (new version 21 11)
 
Mvc3 part1
Mvc3   part1Mvc3   part1
Mvc3 part1
 
Mobile for Enterprise
Mobile for EnterpriseMobile for Enterprise
Mobile for Enterprise
 

Semelhante a Building Restful Web App Rapidly in CakePHP

Principles of MVC for PHP Developers
Principles of MVC for PHP DevelopersPrinciples of MVC for PHP Developers
Principles of MVC for PHP DevelopersEdureka!
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails DevelopersEdureka!
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET Journal
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
PHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniterPHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniterKHALID C
 
Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...
Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...
Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...JPLoft Solutions
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Gaetano Giunta
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCIan Carnaghan
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To MvcVolkan Uzun
 
Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData
Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData
Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData Edureka!
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Umar Ali
 

Semelhante a Building Restful Web App Rapidly in CakePHP (20)

Principles of MVC for PHP Developers
Principles of MVC for PHP DevelopersPrinciples of MVC for PHP Developers
Principles of MVC for PHP Developers
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
 
Know about cake php framework with vertexplus
Know about  cake php framework with vertexplusKnow about  cake php framework with vertexplus
Know about cake php framework with vertexplus
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
IRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHPIRJET- Lightweight MVC Framework in PHP
IRJET- Lightweight MVC Framework in PHP
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
PHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniterPHP Frameworks and CodeIgniter
PHP Frameworks and CodeIgniter
 
P H P Framework
P H P  FrameworkP H P  Framework
P H P Framework
 
cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)cakephp UDUYKTHA (1)
cakephp UDUYKTHA (1)
 
Php Framework
Php FrameworkPhp Framework
Php Framework
 
Php framework
Php frameworkPhp framework
Php framework
 
Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...
Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...
Why CakePHP Is Superior to Other Web Frameworks! Examine Its Pros & Cons For ...
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
Symfony HTTP Kernel for refactoring legacy apps: the eZ Publish case study - ...
 
Programming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVCProgramming is Fun with ASP.NET MVC
Programming is Fun with ASP.NET MVC
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 
Magento
MagentoMagento
Magento
 
Introduction To Mvc
Introduction To MvcIntroduction To Mvc
Introduction To Mvc
 
Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData
Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData
Webinar: Spring Framework - Introduction to Spring WebMVC & Spring with BigData
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4
 

Mais de Edureka!

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaEdureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaEdureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaEdureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaEdureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaEdureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaEdureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaEdureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaEdureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaEdureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaEdureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | EdurekaEdureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEdureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEdureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaEdureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaEdureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaEdureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaEdureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | EdurekaEdureka!
 

Mais de Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
 

Último

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 Scriptwesley chun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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...Martijn de Jong
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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 TerraformAndrey Devyatkin
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Building Restful Web App Rapidly in CakePHP

  • 1. www.edureka.co/php-mysql View PHP & MySQL with MVC Frameworks course details at www.edureka.co/php-mysql For Queries: Post on Twitter @edurekaIN: #askEdureka Post on Facebook /edurekaIN For more details please contact us: US : 1800 275 9730 (toll free) INDIA : +91 88808 62004 Email us : webinar@edureka.co Building Restful Web App Rapidly in CakePHP
  • 2. Slide 2 www.edureka.co/php-mysqlSlide 2 Objectives At the end of this module, you will be able to understand: MVC Architecture CakePHP Introduction Why to Use CakePHP How to Configure CakePHP Creating a Simple Web Application Using CakePHP
  • 3. Slide 3 www.edureka.co/php-mysqlSlide 3  Coding in straight PHP can lead to spaghetti code. Long lines of code that have multiple interactions and typically have HTML code in it  Leads to disorganization  Difficult to re-use code  Change one thing, break another  Everything must be tested, which is difficult  Hard code everything from scratch  Teamwork challenges - parallel programming cannot be done efficiently Drawbacks of Designing an Application Without Using a Framework Design Patterns is a way to organize a program in a proper manner One such design pattern is MVC
  • 4. Slide 4 www.edureka.co/php-mysql Introduction – What is MVC MVC Introduction  MVC is acronym for Model-View-Controller  MVC is software design pattern for developing web and desktop applications  It separates the application logic in easily manageable containers viz Model, View and Controller
  • 5. Slide 5 www.edureka.co/php-mysql MVC Introduction - Model  The Model container manages the data and business logic of the application  Model receives requests for data access from View  It also receives requests from Controller to update the data  Model encapsulates the database and file access from rest of the application logic Model
  • 6. Slide 6 www.edureka.co/php-mysql MVC Introduction - View  The View container manages the presentation of data in specific format  Each model can have multiple views associated with it  View handles all the user interface elements e.g. forms, tables, formatted data  View also implements templates to unify the overall look and feel of the website View
  • 7. Slide 7 www.edureka.co/php-mysql MVC Introduction - Controller  The Controller container manages all the communication between Model and view  Controller is the entry point of all the requests made in the web application  Controller responds to the events, communicate with model and sets data for view  Controller can be considered as brain of the application Controller
  • 8. Slide 8 www.edureka.co/php-mysql MVC Introduction - Illustration Web Browser/Client HTTP Request HTTP Response CONTROLLER MODEL VIEW Data object Request Data Objects Response Render dataEvents (GET/POST) Handled by Framework (Hidden from user) Database Database Request Raw Data Response MVC Container Website User http://www.mywebsite.com
  • 9. Slide 9 www.edureka.co/php-mysql CakePHP - Introduction What is CakePHP?  It is free, open source, rapid development framework for PHP  Follows and implements MVC architecture  Provides a basic structure for organizing files and database table names - keeping everything consistent and logical.  Other available frameworks are Zend framework, CodeIgniter, Laravel etc.
  • 10. Slide 10 www.edureka.co/php-mysql CakePHP - Introduction Why CakePHP?  Open source with flexible licensing  Supports MVC architecture  Easy to install with minimal configuration, faster to learn  Powerful in-build form validation using models  CakeBake to generate ready to use code  Integrated CRUD for database interaction  View helpers for AJAX, JavaScript, HTML forms and more  Email, cookie, security, session, and request handling Components
  • 11. Slide 11 www.edureka.co/php-mysqlSlide 11Slide 11Slide 11 Cake PHP Features Code generation and scaffolding  Scaffolding is a programming technique popularized by Ruby on Rails where code is generated for basic DB operations Easy configuration  Two changes to a file, generate database config Out-of-the-box functionality  DB Support, Form creation , validation Users, authentication Community  Strong, Active  Maintained Plugins Clean MVC Implementation  Industry standard design pattern  Structured application  Easy for developers to read Cake PHP for a long time from 2005  Broad user base  Available documentation
  • 12. Slide 12 www.edureka.co/php-mysql CakePHP - Prerequisite Prerequisite for CakePHP 2.5.6  Apache httpd server 2.4  PHP 5.2.8 or higher  MySQL 4 or higher  We are assuming that we already have PHP and MySQL setup running on the machine
  • 13. Slide 13 www.edureka.co/php-mysql Configuring CakePHP (Contd…)  Download the CakePHP version 2.5.6 zip file from https://github.com/cakephp/cakephp/archive/2.5.6.zip  Extract the zip file to the apache webserver document root directory To get the document root directory location – » Browse to Apache 2.4 directory » Click on conf folder and edit the httpd.conf file » Find the word “DocumentRoot”. It will have the document root directory path.
  • 14. Slide 14 www.edureka.co/php-mysql Configuring CakePHP (Contd…) Document root
  • 15. Slide 15 www.edureka.co/php-mysql Configuring CakePHP (Contd…)  Now Start the apache and MySQL server if it is not already running.  Open web browser and enter http://localhost/cakephp-2.5.6/  Browser will show the CakePHP index page. This means your CakePHP has been setup correctly.  There are some warnings displayed in the index page. We will resolve them in post installation steps next.
  • 16. Slide 16 www.edureka.co/php-mysql Configuring CakePHP (Contd…) Check the installation - Output
  • 17. Slide 17 www.edureka.co/php-mysql CakePHP folder structure CakePHP core directories  There are 4 core directories under CakePHP  app, lib, plugins and vendors
  • 18. Slide 18 www.edureka.co/php-mysql CakePHP folder structure CakePHP core directories  app » Main working directory for CakePHP development » Contains all custom application code including model, view and controller. » Also contains public webroot directory (document root)  lib » Contains all the core CakePHP libraries » DO NOT modify any files in this directory as it will affect the core CakePHP functionality  plugins » Empty by default » Can contain custom plugins made available to enhance CakePHP functionality  vendors » Empty by default » Can contains third party libraries
  • 19. Slide 19 www.edureka.co/php-mysql Creating a Simple Web Application Using CakePHP A Web application to display all the user details with an option to add a new user, edit an existing user and to delete a user using CakePHP Application to perform simple CRUD (Create, Read, Update and Delete) operations Create a Database with name 'Edureka' mysql> create database Edureka Create a Database Table with name "users" in "Edureka" Database with the following fields ID FIRST_NAME LAST_NAME EMAIL MOBILE User Management System