Grails - Custom tag inside the standard Grails tag

You can call the Grails tag inside another using the following syntax.

<g:aContainingGrailsTag value="${aContainedGrailsTag(attr:'whatever')}"

Is it possible to include a custom tag in a Grails tag using the same syntax. I try this way:

<td class="${redOrGreen(number:'i')}"> </td>

but that will not work. Any understanding of this was greatly appreciated.

+5
source share
1 answer

In this particular case, you can do it like this:

<td class="<yourNameSpace:redOrGreen number='i' />"> </td>

or even:

<td class="${yourNameSpace.redOrGreen(number:'i')}"> </td>

Only tags inside g:can be called without a namespace prefix.

+7
source

All Articles