diff --git a/iris.go b/iris.go index 8cc0cc1f..c43d52f2 100644 --- a/iris.go +++ b/iris.go @@ -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) }