class SampleGriffonAddon {
def events = [
NewInstance: { klass, type, instance ->
if(type != "controller") return
instance.metaClass.doit = { evt = null ->
// action code goes here
}
}
]
}
events
property is responsible for providing additional application event handlers. Each event handler is defined by a key (matches the name of the event) and a value (a closure matching the event's arguments).