13 From MVC
Okay, so you’re coming from MVC-land and you’re used to defining routes, defining controlers and defining views.
Lift is different. For HTML requests, Lift loads the view first and builds your page from the view. Lift also supports REST style requests for non-HTML data. (See
11 on page 1↑)
“Why?” Because complex HTML pages rarely contain a dominant piece of logic... a single controller... but contain many different components. Some of those components interact and some do not. In Lift, you define the collection of components to be rendered in the resulting HTML page in the view.
So, to create a page that has dynamic content, we need to do three things:
-
Make a SiteMap entry for the page
-
Create the view (the HTML)
-
Create the behavior (the Snippet that transforms the incoming HTML to the dynamically generated HTML)
(C) 2012 David Pollak