use postfix option for routes to prevent having duplicate view controller methods

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2018-11-19 19:35:56 +01:00
parent 4bd0f4b317
commit b7b80da8c6
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
2 changed files with 2 additions and 22 deletions

View File

@ -24,7 +24,7 @@
return [
'routes' => [
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
['name' => 'page#indexGroup', 'url' => '/{group}', 'verb' => 'GET'],
['name' => 'page#indexContact', 'url' => '/{group}/{contact}', 'verb' => 'GET']
['name' => 'page#index', 'url' => '/{group}', 'verb' => 'GET', 'postfix' => 'group'],
['name' => 'page#index', 'url' => '/{group}/{contact}', 'verb' => 'GET', 'postfix' => 'group.contact']
]
];

View File

@ -50,24 +50,4 @@ class PageController extends Controller {
return new TemplateResponse('contacts', 'main', $params); // templates/main.php
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* Default routing for groups
*/
public function indexGroup(): TemplateResponse {
return $this->index();
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* Default routing for contacts
*/
public function indexContact(): TemplateResponse {
return $this->index();
}
}