Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Geert De Deckere committed Jun 1, 2009
0 parents commit 2f8a389
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.DS_Store
32 changes: 32 additions & 0 deletions classes/pagination.php
@@ -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
11 changes: 11 additions & 0 deletions config/pagination.php
@@ -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,
),

);

0 comments on commit 2f8a389

Please sign in to comment.