grails - Add methods to controllers -
In a Grails application, I would like to add a foo () method for all of my control classes I know that I I can do this with the help of Code:
application.controllerClasses.toList () *. MetaClass * .foo = {println 'foo called'}
However, I just do not want to create a plugin for this purpose. Is there anything else I can do this I suspect that this is possible within the closing of init
bootstrap.groovy
, but I do not know that GrailsApplication
How to reach this stop in the example
Thank you, Don
def grails application = org. Codehaus.groovy.grails.commons.ApplicationHolder.application
Comments
Post a Comment