mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Removing deprecated $this->params in Helpers, it got missed somehow.
Removing PaginatorHelper::$convertKeys. Its just a regular option now. Added some documentation.
This commit is contained in:
parent
ee3017599d
commit
83d12ce690
2 changed files with 17 additions and 21 deletions
|
@ -137,7 +137,6 @@ class Helper extends Object {
|
||||||
*/
|
*/
|
||||||
public function __construct(View $View, $settings = array()) {
|
public function __construct(View $View, $settings = array()) {
|
||||||
$this->_View = $View;
|
$this->_View = $View;
|
||||||
$this->params = $View->params;
|
|
||||||
$this->request = $View->request;
|
$this->request = $View->request;
|
||||||
if (!empty($this->helpers)) {
|
if (!empty($this->helpers)) {
|
||||||
$this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);
|
$this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);
|
||||||
|
|
|
@ -53,34 +53,30 @@ class PaginatorHelper extends AppHelper {
|
||||||
*
|
*
|
||||||
* The values that may be specified are:
|
* The values that may be specified are:
|
||||||
*
|
*
|
||||||
* - `$options['format']` Format of the counter. Supported formats are 'range' and 'pages'
|
* - `$options['format']` Format of the counter. Supported formats are 'range' and 'pages'
|
||||||
* and custom (default). In the default mode the supplied string is parsed and constants are replaced
|
* and custom (default). In the default mode the supplied string is parsed and constants are replaced
|
||||||
* by their actual values.
|
* by their actual values.
|
||||||
* Constants: %page%, %pages%, %current%, %count%, %start%, %end% .
|
* Constants: %page%, %pages%, %current%, %count%, %start%, %end% .
|
||||||
* - `$options['separator']` The separator of the actual page and number of pages (default: ' of ').
|
* - `$options['separator']` The separator of the actual page and number of pages (default: ' of ').
|
||||||
* - `$options['url']` Url of the action. See Router::url()
|
* - `$options['url']` Url of the action. See Router::url()
|
||||||
* - `$options['url']['sort']` the key that the recordset is sorted.
|
* - `$options['url']['sort']` the key that the recordset is sorted.
|
||||||
* - `$options['url']['direction']` Direction of the sorting (default: 'asc').
|
* - `$options['url']['direction']` Direction of the sorting (default: 'asc').
|
||||||
* - `$options['url']['page']` Page # to display.
|
* - `$options['url']['page']` Page # to display.
|
||||||
* - `$options['model']` The name of the model.
|
* - `$options['model']` The name of the model.
|
||||||
* - `$options['escape']` Defines if the title field for the link should be escaped (default: true).
|
* - `$options['escape']` Defines if the title field for the link should be escaped (default: true).
|
||||||
* - `$options['update']` DOM id of the element updated with the results of the AJAX call.
|
* - `$options['update']` DOM id of the element updated with the results of the AJAX call.
|
||||||
* If this key isn't specified Paginator will use plain HTML links.
|
* If this key isn't specified Paginator will use plain HTML links.
|
||||||
* - `$options['paramType']` The type of parameters to use when creating links. Valid options are
|
* - `$options['paramType']` The type of parameters to use when creating links. Valid options are
|
||||||
* 'querystring', 'named', and 'route'. See PaginatorComponent::$settings for more information.
|
* 'querystring', 'named', and 'route'. See PaginatorComponent::$settings for more information.
|
||||||
|
* - `convertKeys` - A list of keys in url arrays that should be converted to querysting params
|
||||||
|
* if paramType == 'querystring'.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
public $options = array();
|
public $options = array(
|
||||||
|
'convertKeys' => array('page', 'limit', 'sort', 'direction')
|
||||||
/**
|
);
|
||||||
* A list of keys that will be turned into `$this->options['paramType']` url parameters when links
|
|
||||||
* are generated
|
|
||||||
*
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
public $convertKeys = array('page', 'limit', 'sort', 'direction');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for the helper. Sets up the helper that is used for creating 'AJAX' links.
|
* Constructor for the helper. Sets up the helper that is used for creating 'AJAX' links.
|
||||||
|
@ -355,6 +351,7 @@ class PaginatorHelper extends AppHelper {
|
||||||
$url = array_merge((array)$options['url'], (array)$url);
|
$url = array_merge((array)$options['url'], (array)$url);
|
||||||
unset($options['url']);
|
unset($options['url']);
|
||||||
}
|
}
|
||||||
|
unset($options['convertKeys']);
|
||||||
|
|
||||||
$url = $this->url($url, true, $model);
|
$url = $this->url($url, true, $model);
|
||||||
|
|
||||||
|
@ -403,7 +400,7 @@ class PaginatorHelper extends AppHelper {
|
||||||
if (!isset($url['?'])) {
|
if (!isset($url['?'])) {
|
||||||
$url['?'] = array();
|
$url['?'] = array();
|
||||||
}
|
}
|
||||||
foreach ($this->convertKeys as $key) {
|
foreach ($this->options['convertKeys'] as $key) {
|
||||||
if (isset($url[$key])) {
|
if (isset($url[$key])) {
|
||||||
$url['?'][$key] = $url[$key];
|
$url['?'][$key] = $url[$key];
|
||||||
unset($url[$key]);
|
unset($url[$key]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue