UrlParams
in component
This is a service class for storing url parameters and building URLs
// define available page parameters // $params = array( 'path' => '', 'letters' => '', // letter 'sort' => 'name', 'order' => 'ASC', 'page' => '1', ); $url_params = new UrlParams($this->request, $params); $params = $url_params->getParams(); if (strlen($params['letters']) > 1) { $params['subletter'] = substr($params['letters'], 1, 1); }
... 'href' => $this->url->link('product/category', $url_params->getUrl(['path' => $path])) ... $pagination->url = $this->url->link('product/category', $url_params->getUrl(['page' => '{page}']));
Table of Contents
Properties
Methods
- __construct() : mixed
- getParam() : mixed
- getParams() : mixed
- getSetParams() : mixed
- getUrl() : mixed
- getUrlParams() : mixed
- getUrlSort() : mixed
- getUrlSortParams() : mixed
- updateParams() : mixed
- buildParams() : mixed
Properties
$default_params
protected
mixed
$default_params
$params
protected
mixed
$params
$request
protected
mixed
$request
$url_array
protected
mixed
$url_array
Methods
__construct()
public
__construct(mixed $request, mixed $default_params[, mixed $keep_original = false ]) : mixed
Parameters
- $request : mixed
- $default_params : mixed
- $keep_original : mixed = false
getParam()
public
getParam(mixed $name) : mixed
Parameters
- $name : mixed
getParams()
public
getParams() : mixed
getSetParams()
public
getSetParams() : mixed
getUrl()
public
getUrl([mixed $params = null ]) : mixed
Parameters
- $params : mixed = null
getUrlParams()
public
getUrlParams([mixed $params = null ]) : mixed
Parameters
- $params : mixed = null
getUrlSort()
public
getUrlSort(mixed $field) : mixed
Parameters
- $field : mixed
getUrlSortParams()
public
getUrlSortParams(mixed $field) : mixed
Parameters
- $field : mixed
updateParams()
public
updateParams(mixed $params) : mixed
Parameters
- $params : mixed
buildParams()
protected
buildParams(mixed $params) : mixed
Parameters
- $params : mixed