SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Controllers
Jill Gundersen
CakePHP Request
 More Detailed Version of the CakePHP Request
Routes
 Parse the Request URL


Extracts parameters



e.g. controller, action, additional values passed in the URL.
http://catalog/items/view/12

 The Request URL Parameters are then Mapped to a Controller Action


A specific action in a specific controller class.




items controller
view action (function)
12 value to use with the database
Controller
 The Controller Interacts With the Model




Controller calls on the model if there is a need to gain access to the
application’s data.
Model interacts with the database and returns data back to the controller.

 The Controller then Interacts With the View




Controller can use the data from the model and manipulate it for the benefit
of the view
After the controller has the prepared the data, the controller passes the data
off to the view
A Tasty Example

Ingredients

Order

Enjoy!

Chef

Placed on Plate
A Tasty Example

Model

Route

End User

Controller

View
What’s In Store?
 Continue Development of Our Catalog Web Site


DVDs, Books, CDs, etc.

 Add to the Controller


Add Actions (functions) to the ItemsController we made in “Getting Started”
module





Display a List all the Items
Create and Delete an Item
Update and Display a Detailed View of an Item
Search the Items
Setting Variables
 Passing Variables to the View


The set() method is used to pass variables to the view.


First Parameter




Second parameter




Provide a name
Provide the value or data

Example


Controller




$this->set(‘pizza’, ‘pepperoni’);

View


Their favorite pizza is <? echo $pizza; ?>.
Query the Database
 Accessing the Database Model in Controller


Access the Model via $this->ModelName


Example




$this->Item

Retrieve Data from the Model Using find() Method


Example
Query the Database
 find() Parameters


First Parameter:




all / first / count / neighbors / list / threaded

Second Parameter:


Array of Data




Example

conditions / fields / joins / limit / offset / order / page / group / callbacks
Single Query
 Query Based on ID



findById()
Example


$this->ModelName->findById($id);
Throw an Exception
 CakePHP Has Many Error Exceptions


http://book.cakephp.org/2.0/en/development/exceptions.html

 Handling Errors



throw new NotFoundException
Example


throw new NotFoundException(__(“Your item was not found”));
Form Data
 CakeRequest





Default request object in CakePHP. Passed by reference to the various layers
of an application.
Assigned to $this->request
Example



Holds all the data from the form (modified and unmodified)
$this->request->data

 Check How the Data Was Sent



is()
Takes One Parameter




post / get / put / delete / head / options / ajax / ssl / flash / mobile

Example


$this->request->is(‘post’);
Create & Save
 Adding a New Item Into a Database





create()
Resets the model state for saving new information. Clears out the model $id
value
Example


$this->ModelName->create();

 Saving the Data



save()
Parameters






1st : Array-formatted data to be saved.
2nd : Allows you to side step validation (bool) – optional
3rd : Supply a list of model fields to be saved. – optional

Example


$this->ModelName->save($this->request->data);
Redirect
 Sending a User to a Different Page




Sometimes it is necessary
redirect()
Parameters:






Example






String action (if in same controller)
Array controller & action
Relative path
$this->redirect(‘index’);
$this->redirect(array( ‘controller’ => ‘Items’, ‘action’ => ‘index’));
$this->redirect(‘/Items/thanks’);

More Redirect Examples


http://book.cakephp.org/2.0/en/controllers.html#flow-control
Saving An Existing Entry
 Saving an Item




Use the same save method that we utilized in the add() action, but we
eliminate the need for the create() method to be called before hand.
Example




$this->ModelName->save($this->request->data);

Override the ‘id’ in our model


Example


$this->ModelName->id = $id;
Populating the Form
 Editing a Form




When you edit an item you need to populate the form with the content of
the item you are editing.
Example



$item = $this>ModelName->findById($id);
$this->request->data = $item;
Set and Display Message
 Session Component


CakePHP provides a messaging system with the session component

 Adding the Session Component to Your Controller


public $components = array('Session');

 Using the Session Component


Example




$this->Session

Access the Method



setFlash()
Parameter




String message you want to display

Example


$this->Session->setFlash(__(“Your record was saved.”));
Does it Exist?
 Previous Determination



$data = $this->ModelName->findById($id)
if(!$data)


Throw Exception

 Check to See if an Item Exists in the Database




exists()
Returns Bool Value
Parameters




$id (optional)

Examples





$this->ModelName->exists($id);
$this->ModelName->id = $id;
$this->ModelName->exists()
Delete Item
 Deleting an Item in the Database




delete()
Returns Bool Value
Parameters




$id (optional)

Examples





$this->ModelName->delete($id);
$this->ModelName->id = $id;
$this->ModelName->delete()
Render Method
 Normal Behavior


Calls the view template of the same name as the action




index() => index.ctp

Called automatically at the end of the action in the controller

 Override




Reuse, Plugins, Elements, etc.
render()
Parameter




Name of the template you would like to use

Example



$this->render(‘index’);
$this->render(‘/Cakes/index’);


app/View/Cakes/index
Summary
 A Review of the MVC Framework


Better understanding of the role of the controller

 Added Actions (Functions) to Our Items Controller


Basic CRUD actions







Create
Read
Update
Delete

Search

Más contenido relacionado

La actualidad más candente

Build website in_django
Build website in_django Build website in_django
Build website in_django swee meng ng
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldGraham Weldon
 
Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Binh Nguyen
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for BeginnersJason Davies
 
Build and deploy Python Django project
Build and deploy Python Django projectBuild and deploy Python Django project
Build and deploy Python Django projectXiaoqi Zhao
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHPAndru Weir
 
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondPloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondDavid Glick
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics PresentationShrinath Shenoy
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using DjangoNathan Eror
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to djangoIlian Iliev
 
Php Unit With Zend Framework Zendcon09
Php Unit With Zend Framework   Zendcon09Php Unit With Zend Framework   Zendcon09
Php Unit With Zend Framework Zendcon09Michelangelo van Dam
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flaskjuzten
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4than sare
 
WordPress Plugin Basics
WordPress Plugin BasicsWordPress Plugin Basics
WordPress Plugin BasicsAmanda Giles
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application FrameworkSimon Willison
 

La actualidad más candente (20)

Build website in_django
Build website in_django Build website in_django
Build website in_django
 
Django
DjangoDjango
Django
 
CakePHP
CakePHPCakePHP
CakePHP
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
 
CakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your worldCakePHP 2.0 - It'll rock your world
CakePHP 2.0 - It'll rock your world
 
Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010Introduction to windows power shell in sharepoint 2010
Introduction to windows power shell in sharepoint 2010
 
Django for Beginners
Django for BeginnersDjango for Beginners
Django for Beginners
 
Build and deploy Python Django project
Build and deploy Python Django projectBuild and deploy Python Django project
Build and deploy Python Django project
 
Flask
FlaskFlask
Flask
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHP
 
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondPloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyond
 
Web development with django - Basics Presentation
Web development with django - Basics PresentationWeb development with django - Basics Presentation
Web development with django - Basics Presentation
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
 
Php Unit With Zend Framework Zendcon09
Php Unit With Zend Framework   Zendcon09Php Unit With Zend Framework   Zendcon09
Php Unit With Zend Framework Zendcon09
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4Spring review_for Semester II of Year 4
Spring review_for Semester II of Year 4
 
Zend framework
Zend frameworkZend framework
Zend framework
 
WordPress Plugin Basics
WordPress Plugin BasicsWordPress Plugin Basics
WordPress Plugin Basics
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application Framework
 

Destacado

2. owin and katana aspdotnet-mvc5-slides
2. owin and katana aspdotnet-mvc5-slides2. owin and katana aspdotnet-mvc5-slides
2. owin and katana aspdotnet-mvc5-slidesMasterCode.vn
 
2 seo-fundamentals-in depth keyword research (part 2)-slides
2 seo-fundamentals-in depth keyword research (part 2)-slides2 seo-fundamentals-in depth keyword research (part 2)-slides
2 seo-fundamentals-in depth keyword research (part 2)-slidesMasterCode.vn
 
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vnPdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vnMasterCode.vn
 
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vnPd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vnMasterCode.vn
 
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vnPd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vnMasterCode.vn
 
7. signal r aspdotnet-mvc5-slides
7. signal r aspdotnet-mvc5-slides7. signal r aspdotnet-mvc5-slides
7. signal r aspdotnet-mvc5-slidesMasterCode.vn
 
8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides
8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides
8. web developer tools and visual studio 2013 aspdotnet-mvc5-slidesMasterCode.vn
 
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
Session 3   inter-servlet communication & filters  - Giáo trình Bách Khoa AptechSession 3   inter-servlet communication & filters  - Giáo trình Bách Khoa Aptech
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa AptechMasterCode.vn
 
6. entity framework 6 aspdotnet-mvc5-slides
6. entity framework 6 aspdotnet-mvc5-slides6. entity framework 6 aspdotnet-mvc5-slides
6. entity framework 6 aspdotnet-mvc5-slidesMasterCode.vn
 
Introducing wcf-slides
Introducing wcf-slidesIntroducing wcf-slides
Introducing wcf-slidesMasterCode.vn
 
5. web api 2 aspdotnet-mvc5-slides
5. web api 2 aspdotnet-mvc5-slides5. web api 2 aspdotnet-mvc5-slides
5. web api 2 aspdotnet-mvc5-slidesMasterCode.vn
 
Pd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vnPd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vnMasterCode.vn
 
Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...
Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...
Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...MasterCode.vn
 
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vnPdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vnPdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vnPd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vnMasterCode.vn
 
THUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHE
THUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHETHUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHE
THUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHEMasterCode.vn
 
ERD - Database Design
ERD - Database DesignERD - Database Design
ERD - Database Designyht4ever
 
Odata consuming-services-slides
Odata consuming-services-slidesOdata consuming-services-slides
Odata consuming-services-slidesMasterCode.vn
 

Destacado (20)

2. owin and katana aspdotnet-mvc5-slides
2. owin and katana aspdotnet-mvc5-slides2. owin and katana aspdotnet-mvc5-slides
2. owin and katana aspdotnet-mvc5-slides
 
2 seo-fundamentals-in depth keyword research (part 2)-slides
2 seo-fundamentals-in depth keyword research (part 2)-slides2 seo-fundamentals-in depth keyword research (part 2)-slides
2 seo-fundamentals-in depth keyword research (part 2)-slides
 
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vnPdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
Pdf buoi3 4-link-building-tran-ngoc-chinh-mastercode.vn
 
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vnPd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vn
 
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vnPd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
Pd fbuoi5 6-ảnh hưởng của social media tới kết quả seo-mastercode.vn
 
7. signal r aspdotnet-mvc5-slides
7. signal r aspdotnet-mvc5-slides7. signal r aspdotnet-mvc5-slides
7. signal r aspdotnet-mvc5-slides
 
8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides
8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides
8. web developer tools and visual studio 2013 aspdotnet-mvc5-slides
 
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
Session 3   inter-servlet communication & filters  - Giáo trình Bách Khoa AptechSession 3   inter-servlet communication & filters  - Giáo trình Bách Khoa Aptech
Session 3 inter-servlet communication & filters - Giáo trình Bách Khoa Aptech
 
6. entity framework 6 aspdotnet-mvc5-slides
6. entity framework 6 aspdotnet-mvc5-slides6. entity framework 6 aspdotnet-mvc5-slides
6. entity framework 6 aspdotnet-mvc5-slides
 
Introducing wcf-slides
Introducing wcf-slidesIntroducing wcf-slides
Introducing wcf-slides
 
5. web api 2 aspdotnet-mvc5-slides
5. web api 2 aspdotnet-mvc5-slides5. web api 2 aspdotnet-mvc5-slides
5. web api 2 aspdotnet-mvc5-slides
 
Pd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vnPd fbuoi7 8--tongquanseo-mastercode.vn
Pd fbuoi7 8--tongquanseo-mastercode.vn
 
Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...
Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...
Pdf bai 7 làm việc với truy vấn nâng cao-slide 07-quan tri csdl voi access-ma...
 
c
cc
c
 
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vnPdfbài 7 máy tính xác tay và máy in   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vnPdfbài 6 bảo trì máy tính   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vn
 
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vnPd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
Pd fbuoi3 4-kỹ thuật xây dựng back link-mastercode.vn
 
THUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHE
THUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHETHUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHE
THUYẾT TRÌNH VỀ TIẾN TRÌNH LẮNG NGHE
 
ERD - Database Design
ERD - Database DesignERD - Database Design
ERD - Database Design
 
Odata consuming-services-slides
Odata consuming-services-slidesOdata consuming-services-slides
Odata consuming-services-slides
 

Similar a 4 introduction-php-mvc-cakephp-m4-controllers-slides

CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)brian d foy
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindiaComplaints
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendalltutorialsruby
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendalltutorialsruby
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel.NET Conf UY
 
How to Create and Load Model in Laravel
How to Create and Load Model in LaravelHow to Create and Load Model in Laravel
How to Create and Load Model in LaravelYogesh singh
 
Agile data presentation 3 - cambridge
Agile data   presentation 3 - cambridgeAgile data   presentation 3 - cambridge
Agile data presentation 3 - cambridgeRomans Malinovskis
 
cake phptutorial
cake phptutorialcake phptutorial
cake phptutorialice27
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django IntroductionGanga Ram
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...LEDC 2016
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindValentine Matsveiko
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 
Http programming in play
Http programming in playHttp programming in play
Http programming in playKnoldus Inc.
 
What's new in Django 1.7
What's new in Django 1.7What's new in Django 1.7
What's new in Django 1.7Daniel Roseman
 
Utilization of zend an ultimate alternate for intense data processing
Utilization of zend  an ultimate alternate for intense data processingUtilization of zend  an ultimate alternate for intense data processing
Utilization of zend an ultimate alternate for intense data processingCareer at Elsner
 

Similar a 4 introduction-php-mvc-cakephp-m4-controllers-slides (20)

Lecture9
Lecture9Lecture9
Lecture9
 
CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)CGI::Prototype (NPW 2006)
CGI::Prototype (NPW 2006)
 
Synapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephpSynapseindia reviews sharing intro cakephp
Synapseindia reviews sharing intro cakephp
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
 
RubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendallRubyOnRails-Cheatsheet-BlaineKendall
RubyOnRails-Cheatsheet-BlaineKendall
 
Building Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel AppelBuilding Modern Websites with ASP.NET by Rachel Appel
Building Modern Websites with ASP.NET by Rachel Appel
 
How to Create and Load Model in Laravel
How to Create and Load Model in LaravelHow to Create and Load Model in Laravel
How to Create and Load Model in Laravel
 
Agile data presentation 3 - cambridge
Agile data   presentation 3 - cambridgeAgile data   presentation 3 - cambridge
Agile data presentation 3 - cambridge
 
Django
DjangoDjango
Django
 
cake phptutorial
cake phptutorialcake phptutorial
cake phptutorial
 
A Basic Django Introduction
A Basic Django IntroductionA Basic Django Introduction
A Basic Django Introduction
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Magento Indexes
Magento IndexesMagento Indexes
Magento Indexes
 
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
Валентин Мацвейко та Владислав Мойсеєнко — D8: Migrate Yourself: code->module...
 
Migrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mindMigrate yourself. code -> module -> mind
Migrate yourself. code -> module -> mind
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
Http programming in play
Http programming in playHttp programming in play
Http programming in play
 
What's new in Django 1.7
What's new in Django 1.7What's new in Django 1.7
What's new in Django 1.7
 
MVC Training Part 1
MVC Training Part 1MVC Training Part 1
MVC Training Part 1
 
Utilization of zend an ultimate alternate for intense data processing
Utilization of zend  an ultimate alternate for intense data processingUtilization of zend  an ultimate alternate for intense data processing
Utilization of zend an ultimate alternate for intense data processing
 

Más de MasterCode.vn

Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vnPd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vnMasterCode.vn
 
Why apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vnWhy apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vnMasterCode.vn
 
Dzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vnDzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vnMasterCode.vn
 
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vnGoogle công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vnMasterCode.vn
 
Nghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vnNghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vnMasterCode.vn
 
Lập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vnLập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vnMasterCode.vn
 
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vnPd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vnMasterCode.vn
 
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vnPdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vnMasterCode.vn
 
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vnPdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vnPdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vnPdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vnPdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vnPdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
 
Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...
Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...
Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...MasterCode.vn
 
Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...
Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...
Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...MasterCode.vn
 
Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...
Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...
Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...MasterCode.vn
 
Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...
Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...
Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...MasterCode.vn
 
Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...
Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...
Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...MasterCode.vn
 
Pdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vn
Pdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vnPdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vn
Pdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vnMasterCode.vn
 
Pdf tim hieuc#vaungdung-mastercode.vn
Pdf tim hieuc#vaungdung-mastercode.vnPdf tim hieuc#vaungdung-mastercode.vn
Pdf tim hieuc#vaungdung-mastercode.vnMasterCode.vn
 

Más de MasterCode.vn (20)

Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vnPd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
Pd ftai lieu-tieng-anh-cho-nguoi-moi-bat-dau-mastercode.vn
 
Why apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vnWhy apps-succeed-wpr-mastercode.vn
Why apps-succeed-wpr-mastercode.vn
 
Dzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vnDzone performancemonitoring2016-mastercode.vn
Dzone performancemonitoring2016-mastercode.vn
 
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vnGoogle công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vn
 
Nghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vnNghiên cứu về khách hàng mastercode.vn
Nghiên cứu về khách hàng mastercode.vn
 
Lập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vnLập trình sáng tạo creative computing textbook mastercode.vn
Lập trình sáng tạo creative computing textbook mastercode.vn
 
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vnPd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vn
 
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vnPdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vn
 
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vnPdfbài 5 bảo trì và tối ưu windows   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vnPdfbài 4 ổ cứng hard drive   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vnPdfbài 3 cpu và ram   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vnPdfbài 1 giới thiệu chung về phần cứng   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vn
 
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vnPdfbài 2 bo mạch chủ (main)   bảo trì sự cố máy tính-mastercode.vn
Pdfbài 2 bo mạch chủ (main) bảo trì sự cố máy tính-mastercode.vn
 
Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...
Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...
Pdf bai 6 làm việc với truy vấn cơ bản-slide 06-quan tri csdl voi access-mast...
 
Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...
Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...
Pdf bai 5 làm việc với báo cáo nâng cao-slide 05-quan tri csdl voi access-mas...
 
Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...
Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...
Pdf bai 4 làm việc với báo cáo cơ bản-slide 04-quan tri csdl voi access-maste...
 
Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...
Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...
Pdf bai 3 làm việc với biểu mẫu nâng cao-slide 03-quan tri csdl voi access-ma...
 
Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...
Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...
Pdf bai 2 làm việc với biểu mẫu cơ bản-slide 02-quan tri csdl voi access-mast...
 
Pdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vn
Pdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vnPdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vn
Pdf bai 1 tổng quan về ms access-quan tri csdl voi access-mastercode.vn
 
Pdf tim hieuc#vaungdung-mastercode.vn
Pdf tim hieuc#vaungdung-mastercode.vnPdf tim hieuc#vaungdung-mastercode.vn
Pdf tim hieuc#vaungdung-mastercode.vn
 

Último

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 

Último (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 

4 introduction-php-mvc-cakephp-m4-controllers-slides

  • 2. CakePHP Request  More Detailed Version of the CakePHP Request
  • 3. Routes  Parse the Request URL  Extracts parameters   e.g. controller, action, additional values passed in the URL. http://catalog/items/view/12  The Request URL Parameters are then Mapped to a Controller Action  A specific action in a specific controller class.    items controller view action (function) 12 value to use with the database
  • 4. Controller  The Controller Interacts With the Model   Controller calls on the model if there is a need to gain access to the application’s data. Model interacts with the database and returns data back to the controller.  The Controller then Interacts With the View   Controller can use the data from the model and manipulate it for the benefit of the view After the controller has the prepared the data, the controller passes the data off to the view
  • 6. A Tasty Example Model Route End User Controller View
  • 7. What’s In Store?  Continue Development of Our Catalog Web Site  DVDs, Books, CDs, etc.  Add to the Controller  Add Actions (functions) to the ItemsController we made in “Getting Started” module     Display a List all the Items Create and Delete an Item Update and Display a Detailed View of an Item Search the Items
  • 8. Setting Variables  Passing Variables to the View  The set() method is used to pass variables to the view.  First Parameter   Second parameter   Provide a name Provide the value or data Example  Controller   $this->set(‘pizza’, ‘pepperoni’); View  Their favorite pizza is <? echo $pizza; ?>.
  • 9. Query the Database  Accessing the Database Model in Controller  Access the Model via $this->ModelName  Example   $this->Item Retrieve Data from the Model Using find() Method  Example
  • 10. Query the Database  find() Parameters  First Parameter:   all / first / count / neighbors / list / threaded Second Parameter:  Array of Data   Example conditions / fields / joins / limit / offset / order / page / group / callbacks
  • 11. Single Query  Query Based on ID   findById() Example  $this->ModelName->findById($id);
  • 12. Throw an Exception  CakePHP Has Many Error Exceptions  http://book.cakephp.org/2.0/en/development/exceptions.html  Handling Errors   throw new NotFoundException Example  throw new NotFoundException(__(“Your item was not found”));
  • 13. Form Data  CakeRequest    Default request object in CakePHP. Passed by reference to the various layers of an application. Assigned to $this->request Example   Holds all the data from the form (modified and unmodified) $this->request->data  Check How the Data Was Sent   is() Takes One Parameter   post / get / put / delete / head / options / ajax / ssl / flash / mobile Example  $this->request->is(‘post’);
  • 14. Create & Save  Adding a New Item Into a Database    create() Resets the model state for saving new information. Clears out the model $id value Example  $this->ModelName->create();  Saving the Data   save() Parameters     1st : Array-formatted data to be saved. 2nd : Allows you to side step validation (bool) – optional 3rd : Supply a list of model fields to be saved. – optional Example  $this->ModelName->save($this->request->data);
  • 15. Redirect  Sending a User to a Different Page    Sometimes it is necessary redirect() Parameters:     Example     String action (if in same controller) Array controller & action Relative path $this->redirect(‘index’); $this->redirect(array( ‘controller’ => ‘Items’, ‘action’ => ‘index’)); $this->redirect(‘/Items/thanks’); More Redirect Examples  http://book.cakephp.org/2.0/en/controllers.html#flow-control
  • 16. Saving An Existing Entry  Saving an Item   Use the same save method that we utilized in the add() action, but we eliminate the need for the create() method to be called before hand. Example   $this->ModelName->save($this->request->data); Override the ‘id’ in our model  Example  $this->ModelName->id = $id;
  • 17. Populating the Form  Editing a Form   When you edit an item you need to populate the form with the content of the item you are editing. Example   $item = $this>ModelName->findById($id); $this->request->data = $item;
  • 18. Set and Display Message  Session Component  CakePHP provides a messaging system with the session component  Adding the Session Component to Your Controller  public $components = array('Session');  Using the Session Component  Example   $this->Session Access the Method   setFlash() Parameter   String message you want to display Example  $this->Session->setFlash(__(“Your record was saved.”));
  • 19. Does it Exist?  Previous Determination   $data = $this->ModelName->findById($id) if(!$data)  Throw Exception  Check to See if an Item Exists in the Database    exists() Returns Bool Value Parameters   $id (optional) Examples    $this->ModelName->exists($id); $this->ModelName->id = $id; $this->ModelName->exists()
  • 20. Delete Item  Deleting an Item in the Database    delete() Returns Bool Value Parameters   $id (optional) Examples    $this->ModelName->delete($id); $this->ModelName->id = $id; $this->ModelName->delete()
  • 21. Render Method  Normal Behavior  Calls the view template of the same name as the action   index() => index.ctp Called automatically at the end of the action in the controller  Override    Reuse, Plugins, Elements, etc. render() Parameter   Name of the template you would like to use Example   $this->render(‘index’); $this->render(‘/Cakes/index’);  app/View/Cakes/index
  • 22. Summary  A Review of the MVC Framework  Better understanding of the role of the controller  Added Actions (Functions) to Our Items Controller  Basic CRUD actions      Create Read Update Delete Search