Add additional methods

This commit is contained in:
ssobolewski 2019-10-20 08:01:21 -06:00
parent eab56d649f
commit a2023cf8f3
1 changed files with 9 additions and 0 deletions

View File

@ -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
}