public function getUrl($page)
    {
        $request = Craft::$app->getRequest();

        // Get the query string params without the path or `pattern`
        parse_str($request->getQueryString(), $params);
        $pathParam = Craft::$app->getConfig()->getGeneral()->pathParam;
        unset($params[$pathParam], $params['pattern']);

        // Return the URL with the page param
        $params[$this->pageParam] = $page;
        return UrlHelper::url($request->getPathInfo(), $params);
    }
public function getUrl($page)
    {
        $request = Craft::$app->getRequest();

        // Get the query string params without the path or `pattern`
        parse_str($request->getQueryString(), $params);
        $pathParam = Craft::$app->getConfig()->getGeneral()->pathParam;
        unset($params[$pathParam], $params['pattern']);

        // Return the URL with the page param
        $params[$this->pageParam] = $page;
        return UrlHelper::url($request->getPathInfo(), $params);
    }
public function getUrl ( $ page ) { $ request = Craft :: $ app -> getRequest ( ) ; // Get the query string params without the path or `pattern` parse_str ( $ request -> getQueryString ( ) , $ params ) ; $ pathParam = Craft :: $ app -> getConfig ( ) -> getGeneral ( ) -> pathParam ; unset ( $ params [ $ pathParam ] , $ params [ 'pattern' ] ) ; // Return the URL with the page param $ params [ $ this -> pageParam ] = $ page ; return UrlHelper :: url ( $ request -> getPathInfo ( ) , $ params ) ; }
Get the url for the given page.

@param int $page
@return string
Get the url for the given page .