[ROUTES] Add redirect from root to main/all, link from header to root, and change parameter order on RouteLoader::connect

This commit is contained in:
Hugo Sales
2020-08-09 13:25:48 +00:00
committed by Hugo Sales
parent 365168d03e
commit cd89cf04ff
3 changed files with 8 additions and 6 deletions

View File

@@ -78,7 +78,7 @@ class RouteLoader extends Loader
* 'fragment', 'http-methods', 'locale', 'methods', 'schemes']
* 'http-methods' and 'methods' are aliases
*/
public function connect(string $id, string $uri_path, $target, ?array $param_reqs = [], ?array $options = [])
public function connect(string $id, string $uri_path, $target, ?array $options = [], ?array $param_reqs = [])
{
$this->rc->add($id,
new Route(
@@ -94,7 +94,8 @@ class RouteLoader extends Loader
'_locale' => $options['locale'] ?? 'en',
'template' => $options['template'] ?? '',
],
$options['defaults'] ?? []),
$options['defaults'] ?? []
),
// requirements = [] -- param => regex
$param_reqs,
// options = [] -- possible keys: compiler_class:, utf8