MicroFrameWork/kernel/routs/admin.php
2024-09-25 14:17:36 +03:00

28 lines
1.2 KiB
PHP

<?php
use kernel\App;
use Phroute\Phroute\RouteCollector;
//App::$collector->filter("auth", function (){
// if(!isset($_COOKIE['user_id']))
// {
// header('Location: /admin/login');
//
// return false;
// }
//});
App::$collector->group(["prefix" => "admin"], function (RouteCollector $router){
// App::$collector->group(["before" => "auth"], function (RouteCollector $router){
// App::$collector->get('/', [\kernel\controllers\ModuleController::class, 'actionIndex']);
// });
// App::$collector->get('/login', [\kernel\modules\secure\controllers\SecureController::class, 'actionLogin']);
// App::$collector->get('/logout', [\kernel\modules\secure\controllers\SecureController::class, 'actionLogout']);
// App::$collector->post('/auth', [\kernel\modules\secure\controllers\SecureController::class, 'actionAuth']);
App::$collector->group(["before" => "auth"], function (RouteCollector $router){
App::$collector->group(["prefix" => "module"], function (RouteCollector $router){
App::$collector->get('/', [\kernel\controllers\ModuleController::class, 'actionIndex']);
App::$collector->get('/activate', [\kernel\controllers\ModuleController::class, 'actionActivate']);
});
});
});