module routing

This commit is contained in:
2024-09-13 16:51:41 +03:00
parent f48d6753e2
commit f20ba63277
5 changed files with 62 additions and 19 deletions

View File

@ -4,6 +4,8 @@ namespace kernel;
use kernel\helpers\Debug;
use kernel\services\ModuleService;
use Phroute\Phroute\Dispatcher;
class App
@ -15,6 +17,8 @@ class App
static Header $header;
public ModuleService $moduleService;
public static Database $db;
public function run(): void
@ -29,6 +33,7 @@ class App
public function load(): static
{
$this->moduleService = new ModuleService();
App::$collector = new CgRouteCollector();
$this->setRouting();
@ -39,6 +44,10 @@ class App
{
include KERNEL_DIR . "/routs/admin.php";
include ROOT_DIR . "/rout.php";
$modules_routs = $this->moduleService->getModulesRouts();
foreach ($modules_routs as $rout){
include "$rout";
}
}
public static function create(): App