We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

PAGINATION

I have many rows result and I don't want to show all page number. I'm using following code,

$currentpage = (int) $this->request->get("page","int");  
$paginator = new Paginator(array(
        "data" => $result,
        "limit" => 15,
        "page" => $currentpage ? $currentpage : 1,
        "showPageList" => false,
        "pageNumber" => 10,
        "pageList" =>array(10,20,50,100)
));
$page = $paginator->getPaginate();
$this->view->setVar("page", $page);
$this->view->pick("product/index");

Can you format your code?



2.0k
edited Jul '14

You can create a partial view too, and then just pick that in your index view.