(Quick Reference)

ui:attributes

Purpose

Writes out a map of HTML attributes cleanly, with option to specify a list of attribute names to include and exclude.

Used in UI templates to cleanly output attributes passed in to UI tags.

Example

<p class="bodytext" ${ui.attributes(from:attrs, exclude:'class')}>
    ${bodyContent}
</fieldset>

Attributes

NameRequired?Description
fromNoA map of attributes to render. If not specified, defaults to "attrs" variable from the current model.
includeNoA set of attribute names or comma delimited string list of names to include. Anything not in this set will be excluded. Default is to include all.
excludeNoA set of attribute names or comma delimited string list of names to exclude. Anything not in this set will be included, provided it passes the include rule.