mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Reformatting code, and removing merging of defaults key in the helper. It no longer exists.
This commit is contained in:
parent
f54479e566
commit
ef84d86cf5
2 changed files with 6 additions and 4 deletions
|
@ -202,7 +202,10 @@ class PaginatorComponent extends Component {
|
|||
array($object->alias => $paging)
|
||||
);
|
||||
|
||||
if (!in_array('Paginator', $this->Controller->helpers) && !array_key_exists('Paginator', $this->Controller->helpers)) {
|
||||
if (
|
||||
!in_array('Paginator', $this->Controller->helpers) &&
|
||||
!array_key_exists('Paginator', $this->Controller->helpers)
|
||||
) {
|
||||
$this->Controller->helpers[] = 'Paginator';
|
||||
}
|
||||
return $results;
|
||||
|
|
|
@ -112,7 +112,6 @@ class PaginatorHelper extends AppHelper {
|
|||
*/
|
||||
public function beforeRender($viewFile) {
|
||||
$this->options['url'] = array_merge($this->request->params['pass'], $this->request->params['named']);
|
||||
|
||||
parent::beforeRender($viewFile);
|
||||
}
|
||||
|
||||
|
@ -191,7 +190,7 @@ class PaginatorHelper extends AppHelper {
|
|||
public function sortKey($model = null, $options = array()) {
|
||||
if (empty($options)) {
|
||||
$params = $this->params($model);
|
||||
$options = array_merge($params['defaults'], $params['options']);
|
||||
$options = $params['options'];
|
||||
}
|
||||
|
||||
if (isset($options['sort']) && !empty($options['sort'])) {
|
||||
|
@ -217,7 +216,7 @@ class PaginatorHelper extends AppHelper {
|
|||
|
||||
if (empty($options)) {
|
||||
$params = $this->params($model);
|
||||
$options = array_merge($params['defaults'], $params['options']);
|
||||
$options = $params['options'];
|
||||
}
|
||||
|
||||
if (isset($options['direction'])) {
|
||||
|
|
Loading…
Reference in a new issue