@TagLib class FormatTagLib extends java.lang.Object implements TagLibrary
The base application tag library for Grails many of which take inspiration from Rails helpers (thanks guys! :) This tag library tends to get extended by others as tags within here can be re-used in said libraries.
Type | Name and description |
---|---|
CodecLookup |
codecLookup |
groovy.lang.Closure |
encodeAs Encodes the body using the specified codec. |
groovy.lang.Closure |
formatBoolean Outputs the given boolean as the specified text label. |
groovy.lang.Closure |
formatDate Outputs the given Date object in the specified format. |
groovy.lang.Closure |
formatNumber Outputs the given number in the specified format. |
GrailsTagDateHelper |
grailsTagDateHelper |
MessageSource |
messageSource |
static java.lang.Object |
returnObjectForTags |
Constructor and description |
---|
FormatTagLib
() |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
messageHelper(java.lang.String code, java.lang.Object defaultMessage, java.util.List args, java.util.Locale locale) |
|
static java.util.Locale |
resolveLocale(java.lang.Object localeAttr) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Encodes the body using the specified codec.
Outputs the given boolean as the specified text label. If the
true
and false
option are not given,
then the boolean is output using the default label.
Examples:
<g:formatBoolean boolean="${myBoolean}" />
<g:formatBoolean boolean="${myBoolean}" true="True!" false="False!" />
Outputs the given Date
object in the specified format. If
the date
is not given, then the current date/time is used.
If the format
option is not given, then the date is output
using the default format.
e.g., <g:formatDate date="${myDate}" format="yyyy-MM-dd HH:mm" />
Outputs the given number in the specified format. If the
format
option is not given, then the number is output
using the default format.
e.g., <g:formatNumber number="${myNumber}" format="###,##0" />
Groovy Documentation