0

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: 'articles_paginated'}) }}

I have urls looking like this :

http://host/articles/page/1

How do I add a param in the view so that the generated urls include some parameters, for example :

http://host/articles/published/1/page/1

Or :

http://host/articles/page/1?published=1
kevin
  • 1,138
  • 2
  • 15
  • 32

1 Answers1

3

Use routeParams :

    {{ pagerfanta(articles, 'twitter_bootstrap4_translated', 
        {
            'routeName': 'articles_paginated',
            'routeParams': {},
        }
    ) }}
Gaylord.P
  • 1,539
  • 2
  • 24
  • 54