-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_usage.php
47 lines (35 loc) · 1004 Bytes
/
example_usage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
kohana-pagination-directories
=============================
Kohana Pagination support for Routes using directories
Example Controller Usage
<?php
$items = Model_Items::get();
$pagination = Pagination::factory(array(
'total_items' => count($items),
'items_per_page' => 14,
'view' => 'pagination/basic',
'auto_hide' => TRUE,
'current_page' => array(
"key" => "page",
"directory" => $this->request->directory(),
"controller" => $this->request->controller(),
"action" => $this->request->action(),
"source" => "directory_route",
),
));
$page_links = $pagination->render();
?>
Example Route Support
<?php
Route::set('members_pagination', '<directory>(/<controller>(/<action>(/<page>)))', array(
'directory' => '(members)',
'controller' => '(photos|videos|articles)',
'action' => '(index)',
))
->defaults(array(
'directory' => 'members',
'controller' => 'home',
'action' => 'index',
'page' => 1,
));
?.