MicroFrameWork/kernel/modules/user/routs/user.php

22 lines
1.4 KiB
PHP
Raw Normal View History

2024-09-10 12:55:41 +03:00
<?php
use app\controllers\MainController;
use kernel\App;
use kernel\modules\admin_themes\controllers\AdminThemeController;
use Phroute\Phroute\RouteCollector;
App::$collector->group(["prefix" => "admin"], function (RouteCollector $router){
2024-10-17 16:47:04 +03:00
App::$collector->group(["before" => "auth"], function (RouteCollector $router) {
App::$collector->group(["prefix" => "user"], callback: function (RouteCollector $router) {
App::$collector->get('/', [\kernel\modules\user\controllers\UserController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [\kernel\modules\user\controllers\UserController::class, 'actionIndex']);
App::$collector->get('/create', [\kernel\modules\user\controllers\UserController::class, 'actionCreate']);
App::$collector->post("/", [\kernel\modules\user\controllers\UserController::class, 'actionAdd']);
App::$collector->get('/{id}', [\kernel\modules\user\controllers\UserController::class, 'actionView']);
App::$collector->any('/update/{id}', [\kernel\modules\user\controllers\UserController::class, 'actionUpdate']);
App::$collector->any("/edit/{id}", [\kernel\modules\user\controllers\UserController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [\kernel\modules\user\controllers\UserController::class, 'actionDelete']);
});
2024-09-10 12:55:41 +03:00
});
});