Rendering Views
Last updated
Last updated
We have now seen how to set views to be rendered from our handlers. However, we can use some cool methods to render views and layouts on-demand. These methods exist in the Renderer and several facade methods exist in the super type so you can call it from any handler, interceptor, view or layout.
renderView()
renderExternalView()
renderLayout()
Check out the latest for the latest arguments:
Inline renderings are a great asset for reusing views and doing layout compositions
If you need rendering capabilities in your model layer, we suggest using the following injection DSL:
This will inject a of a Renderer into your model objects. Remember that renderers are transient objects so you cannot treat them as singletons. The provider is a proxy to the transient object, but you can use it just like the normal object: