mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
remove page attribute from url sef routing
This commit is contained in:
parent
cf9b8de29f
commit
d2cb66f51d
2 changed files with 12 additions and 23 deletions
|
|
@ -17,16 +17,11 @@ class TorrentController extends AbstractController
|
|||
{
|
||||
// Torrent
|
||||
#[Route(
|
||||
'/{_locale}/torrent/{torrentId}/{page}',
|
||||
'/{_locale}/torrent/{torrentId}',
|
||||
name: 'torrent_info',
|
||||
requirements:
|
||||
[
|
||||
'torrentId' => '\d+',
|
||||
'page' => '\d+',
|
||||
],
|
||||
defaults:
|
||||
[
|
||||
'page' => 1,
|
||||
],
|
||||
methods:
|
||||
[
|
||||
|
|
@ -34,7 +29,6 @@ class TorrentController extends AbstractController
|
|||
]
|
||||
)]
|
||||
public function info(
|
||||
int $page,
|
||||
Request $request,
|
||||
TranslatorInterface $translator,
|
||||
UserService $userService,
|
||||
|
|
@ -94,6 +88,9 @@ class TorrentController extends AbstractController
|
|||
$user->getEvents()
|
||||
);
|
||||
|
||||
// Init page
|
||||
$page = $request->get('page') ? (int) $request->get('page') : 1;
|
||||
|
||||
// Render template
|
||||
return $this->render('default/torrent/info.html.twig', [
|
||||
'torrent' =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue