Permalink
Browse files

Check if params is empty on paginated view

  • Loading branch information...
1 parent e90d455 commit 57dc0e83f750f528389b02fb752c0ffa55ec9e79 @apcomplete apcomplete committed Apr 17, 2012
Showing with 10 additions and 7 deletions.
  1. +10 −7 controllers/articles.php
View
@@ -61,14 +61,17 @@ public function _remap($method, $params = array())
}
//check for category
$categories = array();
- if ( ! is_numeric($params[0]) && $params[0] != 'index')
+ if ( ! empty($params))
{
- $categories[] = array_shift($params);
- }
- // clear params if default method call
- if ( ! empty($params) && $params[0] == 'index')
- {
- $params = array();
+ if ( ! is_numeric($params[0]) && $params[0] != 'index')
+ {
+ $categories[] = array_shift($params);
+ }
+ // clear params if default method call
+ if ( $params[0] == 'index')
+ {
+ $params = array();
+ }
}
return $this->paginated($categories, $params, $page);
}

0 comments on commit 57dc0e8

Please sign in to comment.