mirror of
https://github.com/kataras/iris.git
synced 2025-12-22 12:27:02 +00:00
add {{ urlpath }} - returns the path without scheme & domain , near to the {{ url }}
This commit is contained in:
4
iris.go
4
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)
|
s.templates = template.New(s.config.Render.Template)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user