1 00:00:00,012 --> 00:00:02,459 Final step in the MVC model. 2 00:00:02,459 --> 00:00:06,718 The stage just before the end user gets to see anything is the view. 3 00:00:06,718 --> 00:00:10,760 Back to the IMDb example, the model sends data to the controller, but 4 00:00:10,760 --> 00:00:14,607 the controller can't just send raw information back to the user. 5 00:00:14,607 --> 00:00:17,320 It needs to make sure the data is presentable. 6 00:00:17,320 --> 00:00:19,284 That's the job of the view. 7 00:00:19,284 --> 00:00:22,641 The view is the programming that handles presentation. 8 00:00:22,641 --> 00:00:26,080 As with models, you'll have lots of different views. 9 00:00:26,080 --> 00:00:30,176 One for each page or each component on a page. 10 00:00:30,176 --> 00:00:35,523 And almost always, you'll use some templating language that combines data and 11 00:00:35,523 --> 00:00:38,680 templates to create robust web pages or views. 12 00:00:38,680 --> 00:00:43,232 The view essentially returns a complete web page to the controller, 13 00:00:43,232 --> 00:00:45,202 then delivers it to the user. 14 00:00:45,202 --> 00:00:48,307 Again, the controller hands data to the view. 15 00:00:48,307 --> 00:00:53,436 Waits for the view to deliver the results, then sends those results to the user. 16 00:00:53,436 --> 00:00:57,972 A complete web application may include multiple controllers, 17 00:00:57,972 --> 00:01:01,670 models and views that all handle individual tasks. 18 00:01:01,670 --> 00:01:05,171 By dividing tasks into separate modules or functions, 19 00:01:05,171 --> 00:01:09,150 you can build web applications one layer at a time. 20 00:01:09,150 --> 00:01:12,130 Combining different models with different views and 21 00:01:12,130 --> 00:01:15,790 controlling all of them using the centralized logic of the controller. 22 00:01:17,230 --> 00:01:20,140 It might take some time to wrap your head around this approach to 23 00:01:20,140 --> 00:01:22,070 building web applications. 24 00:01:22,070 --> 00:01:26,280 But once you understand the MVC pattern, you'll be able to design and 25 00:01:26,280 --> 00:01:30,610 build web applications more quickly, consistently and effectively.