Url.setQuery
setQuery($paramsMap) -> self
Description
Set the query params of the Url.
Setting the query will overwrite any params that already exist.
To remove a param, set it to an empty string ''
.
$postsUrl = url'/posts/all?sortBy=date' $postsUrl.setQuery({ order: 'desc' page: 2 }) $postsUrl.renderString() //= '/posts/all?sortBy=date&order=desc&page=2'