diff --git a/engine/app/controller/AboutController.php b/engine/app/controller/AboutController.php index 5fea904..c6b24c9 100644 --- a/engine/app/controller/AboutController.php +++ b/engine/app/controller/AboutController.php @@ -6,13 +6,12 @@ class AboutController { public function actionIndex() { - $result = AboutModel::getData(); - var_dump($result); + $result = AboutModel::getData(); + // var_dump($result); echo (View::render([ 'box' => $result, 'body' => 'To home', 'auth' => false ], 'tpl_layout.php')); - print("AboutController, А кто то почувствовал перерыв?"); } } diff --git a/engine/app/controller/AdminController.php b/engine/app/controller/AdminController.php new file mode 100644 index 0000000..9821869 --- /dev/null +++ b/engine/app/controller/AdminController.php @@ -0,0 +1,8 @@ + + + + + + Tailwind Admin Panel + + + + + +
+ + +
+

Dashboard

+

Welcome to the admin panel!

+
+
+ + + + + \ No newline at end of file diff --git a/engine/app/template/tpl_layout.php b/engine/app/template/tpl_layout.php index e111ece..54513b9 100644 --- a/engine/app/template/tpl_layout.php +++ b/engine/app/template/tpl_layout.php @@ -1,29 +1,39 @@ - - + - <?php echo $body; ?> + <?php echo $pageTitle; ?> + - - - - -
exit
+ + +
Выход
+ +
Вход
+ + + +
+ +
-
login
- - - - - - +

Файл "" не найден.

+ - \ No newline at end of file diff --git a/engine/core/Router.php b/engine/core/Router.php index 021d7f2..696b5af 100644 --- a/engine/core/Router.php +++ b/engine/core/Router.php @@ -12,7 +12,7 @@ class Router public function __construct() { - $routesPath = __DIR__ . '/../routes.php'; + $routesPath = __DIR__ . '/../routes.php'; $this->routes = include($routesPath); } @@ -29,6 +29,7 @@ class Router $actionName = 'action' . ucfirst(array_shift($segments)); $controllerObject = new $controllerName(); $result = $controllerObject->$actionName(); + break; // var_dump($controllerFile); } @@ -36,19 +37,8 @@ class Router // Page not found $obj = new MainController(); $obj->actionNotFound(); - // var_dump($obj); - // $controllerName = "MainController"; - // $actionName = "actionIndex"; - // $controllerObject = new $controllerName; - // $result = $controllerObject::$actionName(); - break; + // break; } - $controllerObject = new $controllerName; - $result = $controllerObject::$actionName(); - - // выводим название экшена - echo '
' . $result; - } } diff --git a/engine/routes.php b/engine/routes.php index 08a0c1a..4ec0071 100644 --- a/engine/routes.php +++ b/engine/routes.php @@ -4,6 +4,7 @@ return array( 'news' => 'news/index', // actionIndex в NewsController 'products' => 'product/list', // actionList в ProductController 'about' => 'about/index', + 'admin' => 'admin/index', ); // - где 'news' - строка запроса // 'news/index' - имя контроллера и экшена для обработки этого запроса (путь обработчика)