From f7d7a2be734aefe3bbbc2d3f2d0092c3b6b2dc6a Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 10 Aug 2006 03:55:51 +0000 Subject: [PATCH] Changing pagination key names git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3391 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/controller.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index 146e93f7d..0986755a5 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -969,8 +969,8 @@ class Controller extends Object{ if (isset($options['show'])) { $options['limit'] = $options['show']; } - if (isset($options['sort']) && isset($options['dir'])) { - $options['order'] = array($options['sort'] => $options['dir']); + if (isset($options['sort']) && isset($options['direction'])) { + $options['order'] = array($options['sort'] => $options['direction']); } elseif (isset($options['sort'])) { $options['order'] = $options['sort']; } @@ -999,6 +999,10 @@ class Controller extends Object{ $conditions = $fields = $order = $limit = $page = $recursive = null; $options = am($defaults, $options); extract($options); + if (empty($conditions)) { + $conditions = null; + } + $results = $object->findAll($conditions, $fields, $order, $limit, $page, $recursive); $this->params['paging'][$object->name] = $options; $this->params['paging'][$object->name]['count'] = $object->findCount($conditions);