Add ActivePath as NavItems
This commit is contained in:
@@ -12,6 +12,7 @@ type HtmxContext interface {
|
||||
GetActivePath() *ActivePath
|
||||
HasActivePath() bool
|
||||
SetActivePath(activePath *ActivePath)
|
||||
GetPath() string
|
||||
}
|
||||
|
||||
type HtmxContextImpl struct {
|
||||
@@ -21,6 +22,10 @@ type HtmxContextImpl struct {
|
||||
activePath *ActivePath
|
||||
}
|
||||
|
||||
func (c *HtmxContextImpl) GetPath() string {
|
||||
return c.req.URL.Path
|
||||
}
|
||||
|
||||
func (c *HtmxContextImpl) SetActivePath(activePath *ActivePath) {
|
||||
c.activePath = activePath
|
||||
}
|
||||
@@ -65,6 +70,7 @@ type HtmxRoute interface {
|
||||
ToUrl(queryParams ...HtmxPathParam) string
|
||||
GetHtmx(queryParams ...HtmxPathParam) gomponents.Node
|
||||
SetActivePath(activePath *ActivePath) HtmxRoute
|
||||
Add(server *http.ServeMux)
|
||||
}
|
||||
|
||||
type HtmxGetRoute struct {
|
||||
|
||||
Reference in New Issue
Block a user