mirror of
https://github.com/kataras/iris.git
synced 2025-02-09 02:34:55 +01:00
add {{ urlpath }} - returns the path without scheme & domain , near to the {{ url }}
This commit is contained in:
parent
57c6452e31
commit
721e9ef66f
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)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user