Skip to content

Commit 28ea822

Browse files
committed
rewrite vue routing config
1 parent 2727cd3 commit 28ea822

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

config/routes.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ controllers:
77
api_login_check:
88
path: /api/login
99

10+
vue_route:
11+
path: '/{vueRoute?}'
12+
controller: App\Controller\VueController
13+
requirements:
14+
vueRoute: '^(?!api).+'
15+
1016
user_controller:
1117
resource: ../src/User/Controller/
1218
type: annotation

src/Controller/VueController.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace App\Controller;
66

77
use Symfony\Component\HttpFoundation\Response;
8-
use Symfony\Component\Routing\Annotation\Route;
98
use Twig\Environment;
109

1110
class VueController
@@ -15,13 +14,7 @@ public function __construct(
1514
) {
1615
}
1716

18-
#[Route(
19-
'/{vueRoute?}',
20-
requirements: [
21-
"vueRoute" => "^(?!api).+"
22-
],
23-
)]
24-
public function vueView(): Response
17+
public function __invoke(): Response
2518
{
2619
return new Response($this->twig->render('base.html.twig'));
2720
}

0 commit comments

Comments
 (0)