Version: v0.7.0 - Beta.  We welcome contributors & feedback.

UrlQuery.get

get($paramName, $rule = 'id') -> any

Description

Get the URL param, filtered by the given validation rule.

If the value does not pass validation, it will be returned as an empty string.

$query = url'/page?name=test&num=123'.getQuery()

$query.get('name')
//= 'test'

$query.get('name', 'i')
//= '' (invalid - not an integer)

$query.get('num', 'i')
//= 123

See Also

See Also