I have queryBuilder and I want to use Pagerfanta
So this is my code
$adapter = new DoctrineORMAdapter($queryBuilder);
$pager = new Pagerfanta($adapter);
$pager->setCurrentPage($options['page']);
$pager->setMaxPerPage($options['limit']);
return $pager;
but on frontend when I click on next or choose page it will always show on first page.
I don't know how Pagerfanta working please help.
I've already fixed this.
Because I Pagerfanta don't know what is this page it's still look at default page "$options['page'] == 1"
So I just send parameters page from url to
page = app.request.get('page')
"$options['page']"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.