forked from kerkness/pagination
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Geert De Deckere
committed
Jun 1, 2009
0 parents
commit 2f8a389
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
/** | ||
* Pagination class. | ||
* | ||
* @package Kohana | ||
* @author Kohana Team | ||
* @copyright (c) 2008-2009 Kohana Team | ||
* @license http://kohanaphp.com/license.html | ||
*/ | ||
class Pagination_Core { | ||
|
||
public function __construct(array $config = NULL) | ||
{ | ||
// Make sure $config is an array | ||
$config = (array) $config; | ||
|
||
// Recursively load any requested config groups | ||
while (isset($config['group']) AND isset(Kohana::config('pagination')->$config['group'])) | ||
{ | ||
// Store config group name | ||
$name = $config['group']; | ||
unset($config['group']); | ||
|
||
// Add config group values, not overwriting existing keys | ||
$config += Kohana::config('pagination')->$name; | ||
} | ||
|
||
// Add default config values, not overwriting existing keys | ||
$config += Kohana::config('pagination')->default; | ||
} | ||
|
||
} // End Pagination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php defined('SYSPATH') or die('No direct script access.'); | ||
|
||
return array( | ||
|
||
'default' => array( | ||
'views_dir' => 'pagination', | ||
'style' => 'default', | ||
'items_per_page' => 10, | ||
), | ||
|
||
); |