URLParamDefault returns the get parameter from a request, if not found then "def" is returned.
(name string, def string)
| 1505 | |
| 1506 | // URLParamDefault returns the get parameter from a request, if not found then "def" is returned. |
| 1507 | func (ctx *Context) URLParamDefault(name string, def string) string { |
| 1508 | if v := ctx.getQuery().Get(name); v != "" { |
| 1509 | return v |
| 1510 | } |
| 1511 | |
| 1512 | return def |
| 1513 | } |
| 1514 | |
| 1515 | // URLParam returns the get parameter from a request, if any. |
| 1516 | func (ctx *Context) URLParam(name string) string { |
no test coverage detected