URLParamBool returns the url query parameter as boolean value from a request, returns an error if parse failed.
(name string)
| 1687 | // URLParamBool returns the url query parameter as boolean value from a request, |
| 1688 | // returns an error if parse failed. |
| 1689 | func (ctx *Context) URLParamBool(name string) (bool, error) { |
| 1690 | return strconv.ParseBool(ctx.URLParam(name)) |
| 1691 | } |
| 1692 | |
| 1693 | // URLParamBoolDefault returns the url query parameter as boolean value from a request, |
| 1694 | // if not found or parse failed then "def" is returned. |