Questions tagged [pagerfanta]

Pagerfanta is a pagination library for PHP

Pagerfanta is a pagination library for PHP: https://github.com/whiteoctober/Pagerfanta

36 questions
10
votes
1 answer

Check permission on paginated overview per entity

I'm using voters to check if a user has the correct permissions to perform a certain action on a entity. CRUD actions are easy to check. But how do I check the permissions on result sets or overviews. The overviews use pagination with PagerFanta to…
Waaghals
  • 2,029
  • 16
  • 30
8
votes
2 answers

What is correct way to use Pagerfanta for pagination in Symfony2

I have read that Pagerfanta is the pagination plugin of choice for Symfony2, but I am having some trouble getting it to work correctly. I have downloaded the code for pagerfanta and PagerfantaBundle and installed them as described in the…
j_goldman
  • 231
  • 1
  • 5
  • 16
6
votes
2 answers

Pagerfanta and Doctrine2 COUNT optimization

I'm using Pagerfanta and Doctrine Adapters with Symfony2 and Silex. As my database became bigger I noticed huge load on admin stats pages that display big data with pagination. I checked profiler and saw unbelievably inefficient queries: SELECT…
yefrem
  • 666
  • 7
  • 20
3
votes
3 answers

Unknown "pagerfanta" function

I'm using Pagerfanta bundle with Symfony 3.3.4 and Bootstrap 3; "php": ">=5.5.9", "components/jquery": "^3.2", "doctrine/doctrine-bundle": "^1.6", "doctrine/orm": "^2.5", "incenteev/composer-parameter-handler": "^2.0", …
jdog
  • 2,465
  • 6
  • 40
  • 74
3
votes
2 answers

Symfony2, PagerFanta results

How can I take a result as an array from PagerFanta in Symfony2.1.1 ? $adapter = new \Pagerfanta\Adapter\DoctrineORMAdapter($query); $pager = new \Pagerfanta\Pagerfanta($adapter); $pager->setMaxPerPage(45); $data =…
Dezigo
  • 3,220
  • 3
  • 31
  • 39
2
votes
2 answers

Symfony pagerfanta - can't translate the text in final pagination

I'm trying to translate from english the next and previous in pagination. I've tried creating normal pagerfanta.cs.yaml with Previous: "Předchozí" Next: "Následující" and pagerfanta even has its own translations so it should work by itself, but…
Matys333
  • 23
  • 5
2
votes
0 answers

Pagerfanta returns empty getCurrentPageResults

I have code $qb = $this->createQueryBuilder('country'); $adapter = new DoctrineORMAdapter($qb); $this->pagerfanta = new…
akor
  • 175
  • 1
  • 3
  • 13
2
votes
3 answers

Paginate a shuffled array with Pagerfanta

I have a page that displays 6 items (institutions in my case) on each paginated section of the page (therefore each page). I display the items in a random order using shuffle. I use Symfony 4 and Pagerfanta for the pagination. The problem I face is…
Dirk J. Faber
  • 4,360
  • 5
  • 20
  • 58
2
votes
1 answer

Pagerfanta not working by use queryBuilder in Symfony PHP

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…
B. Godoak
  • 295
  • 6
  • 20
2
votes
2 answers

Customising the layout of Pagerfanta pagination with a custom template

I have Pagerfanta installed and working, however I am having difficulty in customising the layout. I read on Github that I need to pass through my_template, however I am unsure where this should be configured and what specificially this refers…
crmpicco
  • 16,605
  • 26
  • 134
  • 210
2
votes
1 answer

("Parameter "" for route "" must match "[^/]++" ("" given) using pagerfanta

I'm attempting to get PagerFanta working to page my data. I can view the first page and the generated code in the pagerfanta portion generates all the correct links, however when I click on any of those corresponding links I get the exception in the…
John the Ripper
  • 2,389
  • 4
  • 35
  • 61
1
vote
1 answer

Is there an configuration to limit the numbers of page numbers in Pagerfanta pagination?

I have a pagination with Pagerfanta. I want to limit page numbers to 5, since on mobile version pagination is too large. I am using default view 'twitter_bootstrap_translated'. {% if articles.haveToPaginate %}
Milos Ilic
  • 23
  • 4
1
vote
0 answers

FOSRestBundle and Pagerfanta

I'm trying to paginate a result with Pagerfanta My Controller: /** * @Rest\Get( * path="/users", * name="get_users", * ) * * @return View */ public function users() { $pagers =…
Kevin
  • 4,823
  • 6
  • 36
  • 70
1
vote
1 answer

Using only Pagerfanta helpers with Symfony 2 and Twig

I have an application that consumes a webservice. My app send request to webservice like this: Request example: https://mywebservice.com/interesting-route/?page=4&limit=30 So I receive just a slice of result, not the complete array, else I could use…
1
vote
1 answer

Symfony2 PagerFantaBundle

I'm try to use the WhiteOctoberPagerfantaBundle I did follow the install. But the pagination does not work. Here is my controller: $client = $this->getUser()->getsite()->getClient(); $registersQB =…
Kevin
  • 4,823
  • 6
  • 36
  • 70
1
2 3