Created
October 4, 2012 02:52
-
-
Save sergiomichels/3831196 to your computer and use it in GitHub Desktop.
TagLib that overwrite tag and call original
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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