Instead of using string value of a parameter, the attribute formatters use the value of an attribute with a specified name. For more information on attributes, see here.
Inserts the value of the attribute wiht the given name and locale.
Value for FORMAT_TYPE
:
attr-NAME
, where NAME
is the name of the attribute.
The first value of FORMAT_STYLE
is used when the parameter value or attribute value is null.
It must be enclosed with curly braces: {…}
.
Example:
It has the color {0, attr-color, {none}}
It works like the select formatter, but uses the value of the attribute for the select.
Value for FORMAT_TYPE
:
attr:NAME
, where NAME
is the name of the attribute.
Definition for FORMAT_STYLE
is the same as for the select formatter.
Example:
{0} has forgotten {0, attr:gender, female {her} male {his} other {its} } bag.
Back to Formatters