I'm trying to use the taglib call there's attribute parameters, but also the stuff inside the tag itself which the link taglib uses. I can't find the attribute to pass in to a g.link() call to have it render the text of the link. I've tried 'body' and 'link' and 'text' and 'linkText' already - none of those work.
I'm expecting to be able to call
g.link(action:"foo", controller:"bar", _____:"text of the link here")
but don't know what to put in _____
Usually you do it like this:
g.link(action:"foo", controller:"bar", "text of the link here")
The link text doesn't need to be the last parameter, it may appear anywhere:
g.link("text of the link here", action:"foo", controller:"bar")
.
Usage with closure:
Instead of the string you can use a closure which returns a string:
g.link(action:"foo", controller:"bar", {"text of the link here"})
And, as with any groovy closure which is the last parameter for a method call, you can put it after the closing parentheses:
g.link(action:"foo", controller:"bar") {"text of the link here"}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With