Paginator\Adapter\Model

Class Phalcon\Paginator\Adapter\Model

extends abstract class Phalcon\Paginator\Adapter

implements Phalcon\Paginator\AdapterInterface

Source on GitHub

This adapter allows to paginate data using a Phalcon\Mvc\Model resultset as a base.

use Phalcon\Paginator\Adapter\Model;

$paginator = new Model(
    [
        "data"  => Robots::find(),
        "limit" => 25,
        "page"  => $currentPage,
    ]
);

$paginate = $paginator->getPaginate();

登录查看完整内容