Add additional methods
This commit is contained in:
parent
eab56d649f
commit
a2023cf8f3
|
@ -116,3 +116,12 @@ func (c *Context) Redirect(url string) {
|
|||
func (c *Context) QueryValue(key string) string {
|
||||
return c.r.URL.Query().Get(key)
|
||||
}
|
||||
|
||||
func (c *Context) QueryValueWithDefault(key string, def string) string {
|
||||
val := c.r.URL.Query().Get(key)
|
||||
if val == "" {
|
||||
return def
|
||||
}
|
||||
return val
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue