2. PPT Includes
What is MVC ?
Three Layers of MVC
Model Layer
View Layer
Controller Layer
Importance of MVC in CakePHP
http://www.cakephpexpert.com/
3. What is MVC ?
MVC is stands for Model View Controller. MVC is not a design pattern, it is an
Architectural pattern that describes a way to structure our application and
explains responsibilities & interactions for each part in that structure:
Model: Wrapping up data and logics
of CakePHP
View: Output to the Client
MODEL
CONTROL
LER
VIEW
Controller: Manipulating the data from
model and generate the view.
USER
http://www.cakephpexpert.com/
4. Three Layers of MVC
Model Layer
View Layer
Controller Layer
Request
HTTP, CLI
etc.
Controller
Response
HTML, RSS, XML,
JSON etc.
Data
Demand
Model
View
Database, ws, etc.
Templates, Layout
http://www.cakephpexpert.com/
5. Model Layer
Model Layer helps to implement the business logic.
The basic work of model layer is to handle data like
processing, associating, validating and more.
Model layer is also responsible for database
connectivity and saving data to database. Tasks like
storing and retrieving user data would be taking
care by model layer too.
http://www.cakephpexpert.com/
6. View Layer
View Layer offers diverse ways to present data
received from model. It is also using the
information to produce presentable interface,
your application might need.
View layer is responsible to present data to any
supported format and layout such as videos,
music, documents and other format you want.
http://www.cakephpexpert.com/
7. Controller Layer
Controller Layer handles users request. It provides
response to user with the combined action of
model and view layer.
Controller layer is responsible to receive user
requests, fetch suitable resources for task and
select proper view to respond back to client.
http://www.cakephpexpert.com/
8. Importance of MVC in Cakephp
M-V-C separation reduces the complexity when
designing large applications.
Turns an application into manageable and modular
developed project.
Helps in Parallel Development by separate teams.
Easy for developer to Focus and Specialization.
http://www.cakephpexpert.com/