nattreid-visual-paginator

1.4.2 • Public • Published

Visual Paginator pro Nette Framework

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;
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i nattreid-visual-paginator

Weekly Downloads

2

Version

1.4.2

License

MIT

Unpacked Size

4.76 kB

Total Files

6

Last publish

Collaborators

  • attreid