Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Understanding MVC!
You have completed Understanding MVC!
Preview
Learn the role of the view in presenting information to an end user.
This video doesn't have any notes.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Final step in the MVC model.
0:00
The stage just before the end user
gets to see anything is the view.
0:02
Back to the IMDb example, the model
sends data to the controller, but
0:06
the controller can't just send
raw information back to the user.
0:10
It needs to make sure
the data is presentable.
0:14
That's the job of the view.
0:17
The view is the programming
that handles presentation.
0:19
As with models,
you'll have lots of different views.
0:22
One for each page or
each component on a page.
0:26
And almost always, you'll use some
templating language that combines data and
0:30
templates to create robust web pages or
views.
0:35
The view essentially returns
a complete web page to the controller,
0:38
then delivers it to the user.
0:43
Again, the controller
hands data to the view.
0:45
Waits for the view to deliver the results,
then sends those results to the user.
0:48
A complete web application may
include multiple controllers,
0:53
models and
views that all handle individual tasks.
0:57
By dividing tasks into separate modules or
functions,
1:01
you can build web applications
one layer at a time.
1:05
Combining different models
with different views and
1:09
controlling all of them using
the centralized logic of the controller.
1:12
It might take some time to wrap
your head around this approach to
1:17
building web applications.
1:20
But once you understand the MVC pattern,
you'll be able to design and
1:22
build web applications more quickly,
consistently and effectively.
1:26
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up