Renamed current_page source setting from "query" to "query_string". Longer but unambi...
[kohana-pagination.git] / classes / controller / pagination.php
blob5b9a285c5e07cdc0bf3d3f4d11c8823cea6b68ac
1 <?php defined('SYSPATH') or die('No direct script access.');
3 class Controller_Pagination extends Controller {
5 public function action_index()
7 $demo[] = Pagination::factory(array(
8 'total_items' => 211,
9 ))->render();
11 $demo[] = Pagination::factory(array(
12 'current_page' => array('source' => 'route', 'key' => 'page'),
13 'total_items' => 193,
14 'items_per_page' => 20,
15 ))->render();
17 $demo[] = Pagination::factory(array(
18 'current_page' => array('source' => 'query_string', 'key' => 'other_pagenr'),
19 'total_items' => 61,
20 ))->render();
22 $demo[] = Pagination::factory(array(
23 'total_items' => 8,
24 'auto_hide' => FALSE,
25 ))->render();
27 $this->request->response = '<h1>Pagination demos — <a href="'.URL::site($this->request->controller).'">reset</a></h1>'.implode('', $demo);