Pagination of each of these is a pain in the ass. Don't suffer no more!
It is based on PagerFanta for Doctrine 2: Pagerfanta
Doctrine 2 Generic Paginator
It works with either DQL or SQL queries built by respective Query Builders.
Pagerfanta supports adapters, but it is the same concept, except that i have encapsulated.
$qb = new QueryBuilder($this->getDoctrine()->getConnection());
$pag = new DoctrinePaginator($qb, 'COUNT(a.id) as total_rows');
$pag->setMax(25);
$pag->setPage($this->getRequest()->query->get('page', 1));
$pag->getResults();
No need to thank ;)
Nenhum comentário:
Postar um comentário
Comenta aí galera, vamos debater os assuntos!