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:
mark_story 2010-12-26 13:01:20 -05:00
parent ee3017599d
commit 83d12ce690
2 changed files with 17 additions and 21 deletions

View file

@ -137,7 +137,6 @@ class Helper extends Object {
*/
public function __construct(View $View, $settings = array()) {
$this->_View = $View;
$this->params = $View->params;
$this->request = $View->request;
if (!empty($this->helpers)) {
$this->_helperMap = ObjectCollection::normalizeObjectArray($this->helpers);

View file

@ -68,19 +68,15 @@ class PaginatorHelper extends AppHelper {
* 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
* '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
* @access public
*/
public $options = array();
/**
* 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');
public $options = array(
'convertKeys' => array('page', 'limit', 'sort', 'direction')
);
/**
* 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);
unset($options['url']);
}
unset($options['convertKeys']);
$url = $this->url($url, true, $model);
@ -403,7 +400,7 @@ class PaginatorHelper extends AppHelper {
if (!isset($url['?'])) {
$url['?'] = array();
}
foreach ($this->convertKeys as $key) {
foreach ($this->options['convertKeys'] as $key) {
if (isset($url[$key])) {
$url['?'][$key] = $url[$key];
unset($url[$key]);