nattreid / visual-paginator
Visual Paginator for Nette Framework
1.4.2
2018-10-08 12:52 UTC
Requires
- php: >= 7.1
- nette/application: ~2.4
- nette/utils: ~2.4
Requires (Dev)
- nette/database: ~2.4
- nette/tester: ~1.7
- nextras/orm: ~3.0
- tracy/tracy: ~2.4
README
class SomePresenter { function renderDefault() { $model = $this->model->findAll(); $this['paginator']->setPagination($model); $this->template->model = $model; } function createComponentPaginator() { $paginator = new \NAttreid\VisualPaginator\VisualPaginator(10); // 10 polozek na strance, klasicke odkazy $paginator = new \NAttreid\VisualPaginator\VisualPaginator(20); // 20 polozek na strance, ajax -> invalidace snippetu 'data' $paginator->prev = 'Předchozí'; $paginator->next = 'Další'; $paginator->other = '...'; $paginator->setAjaxRequest(); // volani pres ajax $paginator->setNoAjaxHistory(); // vypne historii pres ajax $paginator->onClick[] = function(VPaginator $paginator, $page){ // php kod }; return $paginator; } }