Skip to content

Instantly share code, notes, and snippets.

View sergiomichels's full-sized avatar

Sérgio Michels sergiomichels

View GitHub Profile
@sergiomichels
sergiomichels / MyTagLib.groovy
Created October 4, 2012 02:46
TagLib that uses Grails tags
class MyTagLib {
static namespace = "my"
def input = { attrs, body ->
//some business logic here
//you can access grails tags in the namespace g
out << g.textField(attrs, body)
}
@sergiomichels
sergiomichels / GetGrailsApplication.groovy
Created October 4, 2012 00:54
Get GrailsApplication
def grailsApplication = Holders.getGrailsApplication()
@sergiomichels
sergiomichels / version
Created October 4, 2012 00:47
Get application version in runtime
def version = grailsApplication.metadata['app.version']