Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To append parameters to KNP paginator url

I am using the KNP Paginator bundle for pagination. Does anyone know how to append parameters to the generated url?

Here is my set up:

 {{ knp_pagination_sortable(supplierProducts, 'Product Sku', 'p.name') }}

I want to add &section=supplier to the end of the URL, I just have no clue how to do it. I looked through the docs but did not find any info.

Please help if you can.

Thanks.

like image 700
LargeTuna Avatar asked Oct 25 '25 22:10

LargeTuna


1 Answers

According to the KnpPaginator documentation, you can append query parameters as follows:

$paginator = $this->get('knp_paginator');
...
$pagination->setParam('section', 'supplier');
like image 72
likeitlikeit Avatar answered Oct 27 '25 12:10

likeitlikeit