my code :
if ($this->request->isPost()) {
$query = Criteria::fromInput($this->di, "Phalcon\Models\DvbAdminLogger", $this->request->getPost());
$this->persistent->searchParams = $query->getParams();
} else {
$numberPage = $this->request->getQuery("page", "int");
}
$parameters = array();
if ($this->persistent->searchParams) {
$parameters = $this->persistent->searchParams;
}
$adminLogger = DvbAdminLogger::find($parameters);
$paginator = new Paginator(
array(
"data" => $adminLogger,
"limit" => 15,
"page" => $currentPage,
)
);
$page = $paginator->getPaginate(); //$page->items为当前页数据
$page->pageUrl = '' . $this->dispatcher->getActionName(); //分页点击的url
I find something terrible in Paginator, when I select one page, the data need select all from database. but if there is a big data from a table, how to use limit in Paginator?