mirror of
https://github.com/openvk/chandler.git
synced 2025-02-02 04:25:25 +03:00
Add recursive route inclusion
This commit is contained in:
parent
9a14e22d89
commit
a43eda027b
1 changed files with 5 additions and 1 deletions
|
@ -237,11 +237,15 @@ class Router
|
|||
|
||||
function readRoutes(string $filename, string $namespace, bool $autoprefix = true): void
|
||||
{
|
||||
$config = yaml_parse_file($filename);
|
||||
$config = chandler_parse_yaml($filename);
|
||||
|
||||
if(isset($config["static"]))
|
||||
$this->pushStatic($namespace, CHANDLER_EXTENSIONS_ENABLED . "/$namespace/Web/$config[static]");
|
||||
|
||||
if(isset($config["include"]))
|
||||
foreach($config["include"] as $include)
|
||||
$this->readRoutes(dirname($filename) . "/$include", $namespace, $autoprefix);
|
||||
|
||||
foreach($config["routes"] as $route) {
|
||||
$route = (object) $route;
|
||||
$placeholders = $route->placeholders ?? [];
|
||||
|
|
Loading…
Reference in a new issue