Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Controlling the App1:16 with Jonathan Barrios
Learn how the "controller" in MVC acts as the intermediary between users, data, and presentation.
Although C is the last letter in MVC,
I'm gonna start with it first because it runs the show.
C stands for controller, and it handles a the communication between a user and
the various parts of an application.
For example a, user wouldn't talk directly to the database on IMBb.com.
Instead, they would visit a page like this.
The URL is known as a route, and
represents a request to see information on the classic movie Toy Story.
The URL is routed to the controller.
Remember, the controller handles all of the communication in the app.
The controller then knows that it needs some data.
So it requests information about the movie.
On a complex web application, you may need to create multiple controllers,
each to handle a different type of request.
For example, one controller to handle logging in and out of the website.
Another controller to handle requests for movie data.
Or a handler to process requests from users who want to download movie files.
There are more steps to the process, which I'll discuss in the next videos.
But at this point, keep in mind that controllers act
as an interface between a user and the behind the scenes magic of an app
You need to sign up for Treehouse in order to download course files.Sign up