add {{ urlpath }} - returns the path without scheme & domain , near to the {{ url }}

This commit is contained in:
Makis Maropoulos 2016-06-07 20:29:12 +03:00
parent 57c6452e31
commit 721e9ef66f

View File

@ -124,6 +124,10 @@ func (s *Iris) initTemplates() {
}
})
template.RegisterSharedFunc("urlpath", func(routeName string, args ...interface{}) string {
return s.RouteByName(routeName).ParsePath(args...)
})
s.templates = template.New(s.config.Render.Template)
}