setView()
method in the request context object.setView()
method to set the view views/general/index.cfm
to be rendered. Now the cool thing about this, is that we can override the view to be rendered anytime during the flow of the request. So the last process to execute the setView()
method is the one that counts. Also notice a few things:.cfm
extension is needed./
like normal cfinclude
notation.views
or in your configured external locationsmain.cfm
) will be used.noLayout
argument or event.noLayout()
method:layout
argument or the setLayout()
method:module
argument alongside any other argument combination:event.noRender()
method. Maybe you just took some input and need to gracefully shutdown the request into the infamous white screen of death.event.setView()
if you want, ColdBox will then look for the view according to the executing event's syntax by convention. So if the incoming event is called general.index
and no view is explicitly defined in your handler, ColdBox will look for a view in the general
folder called index.cfm
. That is why we recommend trying to match event resolution to view resolution even if you use or not implicit views.coldbox.implicitViews
configuration setting in your config/ColdBox.cfc
. This is useful as implicit lookups are time-consuming.coldbox.caseSensitiveImplicitViews
directive in your config/ColdBox.cfc
. The default is to turn all implicit views to lower case, so the value is always false.