Skip to content

Commit

Permalink
Make possible use vue-router without problems with PHP routes
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Jul 17, 2023
1 parent 98022e6 commit c4fb4d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions appinfo/routes/routesPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

return [
'routes' => [
// Pages - restricted
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
// default route (Vue.js frontend)
['name' => 'page#index', 'url' => '/{path}', 'verb' => 'GET',
'requirements' => ['path' => '.*'],
'defaults' => ['path' => '']],
],
];
4 changes: 2 additions & 2 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

class PageController extends Controller {
public function __construct(
IRequest $request,
IRequest $request
) {
parent::__construct(Application::APP_ID, $request);
}

#[NoAdminRequired]
#[NoCSRFRequired]
public function index(): TemplateResponse {
public function index(string $path): TemplateResponse {
Util::addScript(Application::APP_ID, 'my_company-main');

$response = new TemplateResponse(Application::APP_ID, 'main');
Expand Down

0 comments on commit c4fb4d8

Please sign in to comment.