module routing
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user