For example, i can put
<g:createLink controller="user" action="show" />
inside a .gsp file and it will work nicely.
But also I'd like to use the same closure createLink
inside a .groovy file which is not part of the grails views
For example, i can put
<g:createLink controller="user" action="show" />
inside a .gsp file and it will work nicely.
But also I'd like to use the same closure createLink
inside a .groovy file which is not part of the grails views
You can use taglib methods from Grails controllers, for example:
def userShow = g.createLink(controller:"user", action:"show")
For builtin taglibs (or those in the g namespace) you can omit the namespace prefix in the method call.