show
action in the blog
controller, for example, Wheels will include the views/blog/show.cfm
file.views
folder.views
folder..cfm
file named after the action..cfm
file in the controller's view folder).action
argument (which will include the view page for that action but not run the controller code for it).template
argument.template
argument, there are specific rules that Wheels will follow in order to locate the file you want to include:/
character, Wheels will start searching from the root of the views
folder. Example: renderView(template="/common/page")
will include the views/common/page.cfm
file./
character elsewhere in the string, the search will start from the controller's view folder. Example: renderView(template="misc/page")
will include the views/blog/misc/page.cfm
file if we're currently in the blog
controller./
character at all), Wheels will just assume the file is in the controller's view folder and try to include it. Example: renderView(template="something")
will include the views/blog/something.cfm
file if we're currently in the blog
controller.renderView(template="thepage")
and renderView(template="thepage.cfm")
work fine. But most of the time, Wheels developers will tend to leave out the .cfm
part.variables
scope if you prefer to set it explicitly) in the controller so that they are available to the view template.params
struct. This contains anything passed in through the URL or with a form. If you want to follow MVC rules more closely though, we recommend only accessing the params
struct in the controller and then setting new variables for the information you need access to in the view.title
column from a query object called posts
, it should encode HTML special characters:EncodeForUrl
, EncodeForHtml
and EncodeForHtmlAttribute
internally as needed.true
):encodeHtmlAttributes
: When true
, calls EncodeForHtmlAttribute
to encode attribute values in linkTo, textAreaTag etc.encode
argument (can be set to true
/ false
or attributes
) that overrides the global setting. Setting it to attributes
will only encode HTML attribute values but leave tag content as is. Note that the attributes
option is not available on functions that don't produce any tag content (such as imageTag for example), in those cases it's enough to pass in either true
or false
.