Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial commit

  • Loading branch information...
commit 2f8a3895f8bac47e0dd151f6aed1c69f69f495be 0 parents
Geert De Deckere authored
1  .gitignore
... ... @@ -0,0 +1 @@
  1 +.DS_Store
32 classes/pagination.php
... ... @@ -0,0 +1,32 @@
  1 +<?php defined('SYSPATH') or die('No direct script access.');
  2 +/**
  3 + * Pagination class.
  4 + *
  5 + * @package Kohana
  6 + * @author Kohana Team
  7 + * @copyright (c) 2008-2009 Kohana Team
  8 + * @license http://kohanaphp.com/license.html
  9 + */
  10 +class Pagination_Core {
  11 +
  12 + public function __construct(array $config = NULL)
  13 + {
  14 + // Make sure $config is an array
  15 + $config = (array) $config;
  16 +
  17 + // Recursively load any requested config groups
  18 + while (isset($config['group']) AND isset(Kohana::config('pagination')->$config['group']))
  19 + {
  20 + // Store config group name
  21 + $name = $config['group'];
  22 + unset($config['group']);
  23 +
  24 + // Add config group values, not overwriting existing keys
  25 + $config += Kohana::config('pagination')->$name;
  26 + }
  27 +
  28 + // Add default config values, not overwriting existing keys
  29 + $config += Kohana::config('pagination')->default;
  30 + }
  31 +
  32 +} // End Pagination
11 config/pagination.php
... ... @@ -0,0 +1,11 @@
  1 +<?php defined('SYSPATH') or die('No direct script access.');
  2 +
  3 +return array(
  4 +
  5 + 'default' => array(
  6 + 'views_dir' => 'pagination',
  7 + 'style' => 'default',
  8 + 'items_per_page' => 10,
  9 + ),
  10 +
  11 +);

0 comments on commit 2f8a389

Please sign in to comment.
Something went wrong with that request. Please try again.