Questions tagged [pagerfanta]

Pagerfanta is a pagination library for PHP

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

36 questions
1
vote
1 answer

Symfony2 pagerfanta DQL with leftjoin

I'm trying to paginate a query that uses DQL (because I'm going to use some group functions like sum) and has an outer join, here a simplified code: //in controller use Pagerfanta\Pagerfanta, Pagerfanta\Adapter\DoctrineORMAdapter as…
salas_e
  • 46
  • 7
0
votes
1 answer

Pagerfanta template causing error in psalm

I am trying to move from phpdoc to psalm and I am getting weird error with its template based returns. class Message {} interface FooInterface { /** @return Pagerfanta|Message[] */ public function getMessages(): Pagerfanta; } This is…
HubertNNN
  • 1,727
  • 1
  • 14
  • 29
0
votes
1 answer

Slow query on smaller MySQL server

I am running MySQL 5.7 on both my server and my local machine. I am using Symfony 4.4 and Doctrine. On my dev machine the following query (with the same DB dumped from the server) executes in ~2s, while it takes 35s+ on the server. I assume this is…
Schyzophrenic
  • 131
  • 1
  • 9
0
votes
2 answers

search result combined with pagerfanta

i have an app, which displays a list of items, in the main page i have add form with two inputs, the first will contain the month value and the second one will take a year value; i set up the action inside the controller in that action there is a…
Mohamed Aarab
  • 846
  • 1
  • 11
  • 16
0
votes
1 answer

List of entites not converting to json instead I get an array of empty objects

I have the following code: public function adminListAction(Request $request) { if (!$this->isGranted('ROLE_ADMIN')) { return new JsonResponse("Not granted"); } $page = $request->query->get('page', 1); $criteria = new…
JonnyD
  • 73
  • 2
  • 9
0
votes
1 answer

JMS Groups Serialization and PagerFantaBundle

I'm working on a RESTFull API with Symfony and FOSRESTBundle. I use the JMS Serializer with groups to show differents fields depending on the context. For listing my resources, I want implement PagerFantaBundle. All work fine except that PagerFanta…
Flyzzx
  • 458
  • 5
  • 13
0
votes
1 answer

Pagerfanta does not like my doctrine query

In an application built on the symfony 4 framwork, I use a query in my user repository to find users with a specific role, that looks like this: public function findByRole($role) { $qb = $this->_em->createQueryBuilder(); $qb->select('u') …
Dirk J. Faber
  • 4,360
  • 5
  • 20
  • 58
0
votes
1 answer

Serializing doctrine object with ManyToMany relation

I'm trying to serialize object to json by following symfony official docs. I'v got Pagerfanta object(getting it from repository just like in Demo Application) public function findOneIncRel(int $page = 1): Pagerfanta { $query =…
user5843249
0
votes
1 answer

How to get the number of result? - Pagerfanta and Twig (in Symfony)

In my Demo application, use Pagerfanta to read only a few rows from Database. public function findAllProductsByCategory($category, int $page = 1): Pagerfanta { // DQL = Always select full classes from classes $query =…
ABSimon
  • 651
  • 1
  • 6
  • 18
0
votes
1 answer

How do I add query params to pagerfanta paginator with symfony 4?

I'm using pagerfanta with symfony 4. I'm paginating DoctrineORM results with pagerfanta. I want to paginate search results, without query params it's all working great : {{ pagerfanta(articles, 'twitter_bootstrap4_translated', {routeName:…
kevin
  • 1,138
  • 2
  • 15
  • 32
0
votes
1 answer

Symfony3 Doctrine queryBuilder for pagerfanta on ManyToMany realationship

I have strange problem here but first a quick explanation of what is the idea. We have system where all users can upload files. Each user will have favorite files and I need to add pagination. My User entity: /** * User * *…
0
votes
1 answer

Twig and pagerfanta get the fieldname and the fieldname.value

I'm trying to get the fieldname of a pagerfanta results. Twig template {% for post in posts %} {{ dump(post) }} {% endfor %} The dump result is: Users {#764 ▼ -iduser: 11 -username: "xzvdsfg" -password: "SHHHHHH" -lastlogin: DateTime {#691…
German
  • 1
0
votes
1 answer

PagerFanta issue: setMaxPerPage not working

i trying to create a paginator when i display products but the $paginator->setMaxPerPage() and $paginator->setCurrentPage() are not working : my repository method : public function findLatestBySubcategAndTaxon($ids, $taxon_id) { $sids =…
0
votes
2 answers

Symfony2 Pager Fanta

Is it posible to set the route / render controller with pager fanta in symfony2 because i have tried rendering a controller and it hits me with cannot generate route: An exception has been thrown during the rendering of a template ("Unable to…
L.S
  • 399
  • 1
  • 5
  • 19
0
votes
1 answer

Pagerfanta symfony Pagination

I have a mysql database blog with 21 posts in it. I set $maxPerPage = '3'; So I get 7 pages, but from page 4 I get the following error: OutOfRangeCurrentPageException: Page "4" does not exist. The currentPage must be inferior to "3" Here's my code: …
Redman
  • 133
  • 1
  • 1
  • 10