Pārlūkot izejas kodu

Set controller in Core class

Alan Lam 7 gadi atpakaļ
vecāks
revīzija
3c2ca51449
2 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 2 0
      engine/core.php
  2. 1 0
      router.php

+ 2 - 0
engine/core.php

@@ -5,6 +5,8 @@ class Core {
 	public static $user = null;
 	public static $admin = false;
 
+	public static $controller = "404";
+
 	public static $breadcrumbs = [];
 
 	public static $use_default_container = true;

+ 1 - 0
router.php

@@ -18,6 +18,7 @@ try {
 
 			// Get controller
 			$controller = $options["controller"];
+			Core::$controller = $controller;
 
 			// Get route type
 			$route_type = $options["type"] ?? "page";