Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function __construct()
- {
- parent::__construct(\Base::instance()->get('DB'), 'members');
- }
- public function index($f3)
- {
- $collection = new self();
- $limit = 10;
- $page = $f3->get('PARAMS.page');
- $paginateLink = $page;
- $pageresults = $page * $limit;
- $collection->fields(array('username', 'email')));
- $thing = $collection->paginate(0, $limit, null, [
- 'order' => 'username asc',
- ]);
- if ($page != null) {
- $f3->set('previous', $paginateLink - 1);
- }
- if ($page != $thing['count']) {
- $f3->set('next', $paginateLink + 1);
- }
- $f3->set('pagecount', $thing['count']);
- $f3->set('members', $thing['subset']);
- $f3->set('content', 'userlist.html');
- echo Template::instance()->render('index.html');
- }
Advertisement
Add Comment
Please, Sign In to add comment