<g:if test="${name == 'fred'}">
Hello ${name}!
</g:if>
<g:if env="development">
Dev mode - debug: $someDebug
</g:if>
<g:if env="production" test="${cacheEnabled}">
$cache.getContent('1234')
</g:if>
1. if
1.1. Purpose
The logical if tag to switch on an expression and/or current environment.
1.2. Examples
1.3. Description
Attributes
-
test
- The expression to test -
env
- An environment name
At least one of the attributes must be supplied. If both are supplied they are combined using AND.