Reputation: 1
I would like to have prefix for page in url, like this:
http://host/list/page_5
/**
* @Route("/list/{page}", name="list", requirements={"page" = "page_\d+"})
...
$pagination = $paginator->paginate(
$query,
$this->get('request')->query->get('page') /*page number*/,
5 /*limit per page*/
);
In case of using just numbers - it works fine. But what is best way to use pagination and these page prefixes in urls?
Upvotes: 0
Views: 799
Reputation: 1311
Change route schema into
@Route("/list/page_{page}", name="list", requirements={"page" = "\d+"})
Upvotes: 1