add query
This commit is contained in:
parent
f79d3f28e2
commit
908931bc01
|
@ -38,6 +38,14 @@ func (c *Context) Param(key string) string {
|
||||||
return c.ctx.Param(key)
|
return c.ctx.Param(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Context) Query(key string) string {
|
||||||
|
qs := c.ctx.Request.URL.Query()
|
||||||
|
if qs != nil {
|
||||||
|
return qs.Get(key)
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Context) Bind(val any) (err error) {
|
func (c *Context) Bind(val any) (err error) {
|
||||||
// if params exists, try bind params first
|
// if params exists, try bind params first
|
||||||
if len(c.ctx.Params) > 0 {
|
if len(c.ctx.Params) > 0 {
|
||||||
|
|
Loading…
Reference in New Issue