diff --git a/app/modules/tgbot/controllers/TgMainController.php b/app/modules/tgbot/controllers/TgMainController.php new file mode 100644 index 0000000..1e27073 --- /dev/null +++ b/app/modules/tgbot/controllers/TgMainController.php @@ -0,0 +1,24 @@ +cgView->viewPath = APP_DIR . "/modules/tgbot/views/tgbot/main/"; + $this->cgView->layout = "main.php"; + $this->cgView->layoutPath = APP_DIR . "/modules/tgbot/views/tgbot/layout/"; + $this->cgView->addVarToLayout("resources", "/resources/main"); + } + + public function actionMain(): void + { + $this->cgView->render("index.php"); + } + +} \ No newline at end of file diff --git a/app/modules/tgbot/routs/tgbot.php b/app/modules/tgbot/routs/tgbot.php index 4f5b087..dfe53f5 100644 --- a/app/modules/tgbot/routs/tgbot.php +++ b/app/modules/tgbot/routs/tgbot.php @@ -1,3 +1,11 @@ group(["prefix" => "miniapp"], function (CGRouteCollector $router) { + App::$collector->get('/', [\app\modules\tgbot\controllers\TgMainController::class, 'actionMain']); +}); \ No newline at end of file diff --git a/app/modules/tgbot/views/tgbot/layout/main.php b/app/modules/tgbot/views/tgbot/layout/main.php new file mode 100644 index 0000000..e79f5cd --- /dev/null +++ b/app/modules/tgbot/views/tgbot/layout/main.php @@ -0,0 +1,78 @@ + + + +
+