Skip to content
Browse files

Initial commit

  • Loading branch information...
0 parents commit 2f8a3895f8bac47e0dd151f6aed1c69f69f495be Geert De Deckere committed Jun 1, 2009
Showing with 44 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +32 −0 classes/pagination.php
  3. +11 −0 config/pagination.php
1 .gitignore
@@ -0,0 +1 @@
+.DS_Store
32 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 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.
Something went wrong with that request. Please try again.