tg main page
This commit is contained in:
24
app/modules/tgbot/controllers/TgMainController.php
Normal file
24
app/modules/tgbot/controllers/TgMainController.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace app\modules\tgbot\controllers;
|
||||
|
||||
use kernel\Controller;
|
||||
|
||||
class TgMainController extends Controller
|
||||
{
|
||||
|
||||
protected function init(): void
|
||||
{
|
||||
parent::init();
|
||||
$this->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");
|
||||
}
|
||||
|
||||
}
|
@ -1,3 +1,11 @@
|
||||
<?php
|
||||
|
||||
include KERNEL_APP_MODULES_DIR . "/tgbot/routs/tgbot.php";
|
||||
use kernel\App;
|
||||
use kernel\CgRouteCollector;
|
||||
|
||||
include KERNEL_APP_MODULES_DIR . "/tgbot/routs/tgbot.php";
|
||||
|
||||
|
||||
App::$collector->group(["prefix" => "miniapp"], function (CGRouteCollector $router) {
|
||||
App::$collector->get('/', [\app\modules\tgbot\controllers\TgMainController::class, 'actionMain']);
|
||||
});
|
78
app/modules/tgbot/views/tgbot/layout/main.php
Normal file
78
app/modules/tgbot/views/tgbot/layout/main.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* @var $content
|
||||
* @var string $resources
|
||||
* @var string $title
|
||||
* @var \kernel\CgView $view
|
||||
*/
|
||||
\Josantonius\Session\Facades\Session::start();
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title><?= $title ?></title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<?= $view->getMeta() ?>
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900" rel="stylesheet">
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="<?= $resources ?>/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?= $resources ?>/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="wrapper d-flex align-items-stretch">
|
||||
<!-- Page Content -->
|
||||
<div id="content" class="p-4 p-md-5">
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
|
||||
<button class="btn btn-dark d-inline-block d-lg-none ml-auto" type="button" data-toggle="collapse"
|
||||
data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<i class="fa fa-bars"></i>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="nav navbar-nav ml-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="/admin/logout">Выход</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Portfolio</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Contact</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<?php if (\kernel\Flash::hasMessage("error")): ?>
|
||||
<div class="alert alert-danger alert-dismissible mainAlert">
|
||||
<?= \kernel\Flash::getMessage("error"); ?>
|
||||
<button type="button" class="btn-close closeAlertBtn"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if (\kernel\Flash::hasMessage("success")): ?>
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<?= \kernel\Flash::getMessage("success"); ?>
|
||||
<button type="button" class="btn-close closeAlertBtn"></button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?= $content ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="<?= $resources ?>/js/jquery.min.js"></script>
|
||||
<script src="<?= $resources ?>/js/popper.js"></script>
|
||||
<script src="<?= $resources ?>/js/bootstrap.min.js"></script>
|
||||
<script src="<?= $resources ?>/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
3
app/modules/tgbot/views/tgbot/main/index.php
Normal file
3
app/modules/tgbot/views/tgbot/main/index.php
Normal file
@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
echo "Hello Telegram";
|
Reference in New Issue
Block a user