Skip to content

Instantly share code, notes, and snippets.

@sergiomichels
Created October 4, 2012 02:52
Show Gist options
  • Select an option

  • Save sergiomichels/3831196 to your computer and use it in GitHub Desktop.

Select an option

Save sergiomichels/3831196 to your computer and use it in GitHub Desktop.
TagLib that overwrite tag and call original
class MyExtendedTagLib {
static namespace = "my"
def grailsApplication
def input = {attrs, body ->
//some custom logic that changes attrs here...
//get the original TagLib, must be the complete path
def myTagLib = grailsApplication.mainContext.getBean("packages.MyTagLib")
//and then we can call the original Closure
myTagLib.input.call(attrs, body)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment