<?php
namespace App\EventSubscriber;
use Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination;
use Knp\Component\Pager\Event\AfterEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class PaginatorSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
'knp_pager.after' => ['after', 1]
];
}
public function after(AfterEvent $afterEvent): void
{
/** @var SlidingPagination $paginator */
$paginator = $afterEvent->getPaginationView();
$paginator->setParam('id', null);
}
}