Skip to content
No description or website provided.
PHP
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
classes
views/pagination
README.md

README.md

Kohana Pagination

There are many like it, but this one is mine.

The default view uses the Bootstrap pagination markup.

Usage

Controller

<?php

# Make sure you have <page> defined in your route (or a different parameter - see Pagination::$route_page_param

...

public function action_user() {
    $users = ORM::factory('users');
    # Add where clause, etc, here if filtering
    $pagination = new Pagination($users, $this->request->param('page'), 'admin_user');
    $this->template->content->pagination = $pagination;
}

View

<?php echo $pagination->render(); ?>

<?php foreach ($pagination->result() as $user): ?>
    Username: <?php echo $user->username; ?><br />
    Email: <?php echo $user->email; ?><br />
    <br />
<?php endforeach; ?>

<?php echo $pagination->render(); ?>
Something went wrong with that request. Please try again.