Questions tagged [knppaginator]

Paginator bundle for Symfony2 (PHP Framework) to automate pagination and simplify sorting and other features.

SEO friendly Symfony2 paginator to paginate everything.

Generally this bundle is based on Knp Pager component. This component introduces a different way for pagination handling. Suitable to paginate ODM mongodb and ORM 2.0 queries.

Link to GitHub repo

131 questions
11
votes
2 answers

JMS Serializer ignores mappings for Knp Paginator

I have problem with exclusion of some KNP Paginator properties with JMS Serializer. First, this is included in composer.json ... "jms/serializer-bundle": "~0.13", "knplabs/knp-paginator-bundle": "2.4.*@dev", ... I'm paginating CrmContacts entity…
nbucic
  • 163
  • 1
  • 10
10
votes
1 answer

'templating.helper.router' service is not found in symfony 2.7

i upgarde my project from 2.6 to 2.7, i get this error in end of work: [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] The service "knp_paginator.helper.processor" has a…
ghanbari
  • 1,630
  • 1
  • 16
  • 31
10
votes
3 answers

How to use KNPPaginatorBundle to paginate results using Doctrine Repository?

I'm working on a Symfony2 project and I decided to use KNPPaginatorBundle to build an easy pagination system. So I created a Product entity and I want to add the paginator to indexAction action (generated by CRUD command). // Retrieving…
K4timini
  • 711
  • 2
  • 14
  • 34
9
votes
3 answers

Symfony2 Doctrine error: Cannot count query that uses a HAVING clause. Use the output walkers for pagination

I am trying to get collections that are non-empty, i.e. have at least 1 object. Collection entity has OneToMany relationship with Object entity. I am using KNP paginator to paginate result. This is my function: public function fetchAction(Request…
gggg
  • 283
  • 3
  • 9
7
votes
2 answers

Configure KnpPaginator to work with Twitter Bootstrap

i'm trying to apply twitter bootstrap css style to my knp pagination without modifying the vendor. Is there a way to configure KnpPaginator so to detect existing bootstrap css style sheets?because as the screenshot shows, it is build to work with…
Shade
  • 321
  • 1
  • 2
  • 12
6
votes
5 answers

Knp Paginator with findAll() method

I have the Problem, that the knp paginator only works like this: $em = $this->get('doctrine.orm.entity_manager'); $dql = "SELECT a FROM MainArtBundle:Art a"; $query = $em->createQuery($dql); $paginator =…
Slowwie
  • 1,146
  • 2
  • 20
  • 36
6
votes
2 answers

How to get Pagination direction in twig for KNP paginator?

I am using knp paginator and it works well but when I want to use its sorting feature I have problem to get the sort direction in twig. the following code is indicate how to get the sorted table header but not taking about how to get sorted table…
Ehsan
  • 286
  • 2
  • 4
  • 14
5
votes
1 answer

How to configure KnpPaginatorBundle for Symfony 4

I’m looking to implement KnpPaginatorBundle into symfony4. My issue here is that , in their documentation (meant for S3) they recommend using the following parameters i config.yml. knp_paginator: page_range: 5 # number of…
Miles M.
  • 4,089
  • 12
  • 62
  • 108
5
votes
2 answers

How can I improve KnpPaginatorBundle and Doctrine speed?

I have a huge product table (100k+ rows) and in my controller I have the following function: public function indexAction(Request $request) { $findProducts = $this->getDoctrine() …
yeouuu
  • 1,863
  • 3
  • 15
  • 32
5
votes
1 answer

Is there a way to make the knp paginator show only show next and previous buttons

How it renders it 1 2 3 > >> (page numbers, next button, last page button) How I need it to render > (only next button) How the render method is triggered on the twig file
user3531149
  • 1,519
  • 3
  • 30
  • 48
5
votes
1 answer

KnpPaginator and native query

I use KnpPaginatorBundle in my Symfony2 project. When i try to pass a Doctrine 2 native query to paginator instance, I got error: One of listeners must count and slice given target Have anyone some example of correct implementation of this for some…
shinji
  • 55
  • 1
  • 4
4
votes
1 answer

Knp paginator get all rows total

As I noticed in SQL query logger Knp paginator at first counts all records available and then in second query retrieves records that are needed in requested page. I wonder if there is some way to update first query to retrieve additional counts/sums…
dMedia
  • 809
  • 1
  • 10
  • 18
4
votes
1 answer

One of listeners must count and slice given target

I'm getting the above error when performing a search in a Symfony2 CRM I've been working on. According to Google searches it seems this is an issue relating to the KNP Paginator bundle, but I cannot seem to find a solid solution. In this instance, I…
Michael Emerson
  • 1,774
  • 4
  • 31
  • 71
4
votes
1 answer

Sorting not working in Knp paginator

I am using the knp paginator bundle and i got this error There is no such field [catalogId] in the given Query component, aliased by [u] . Sorting works fine if i click in the title but it shows me an error if i click in the catalogid.CatalogId is…
Raaz
  • 1,669
  • 2
  • 24
  • 48
4
votes
3 answers

How to get current item index Knp paginator

I am trying to get the current index of the item that is current displaying in knp paginator bundle, atm i have something like this: {% for index, post in posts %} {{ index + 1 }} {% endfor %} However this only displays for example 1 - 10,…
Maxim
  • 3,836
  • 6
  • 42
  • 64
1
2 3
8 9