diff --git a/kernel/modules/slider/SliderModule.php b/kernel/app_modules/slider/SliderModule.php similarity index 89% rename from kernel/modules/slider/SliderModule.php rename to kernel/app_modules/slider/SliderModule.php index b8e1ed1..ada5bb4 100644 --- a/kernel/modules/slider/SliderModule.php +++ b/kernel/app_modules/slider/SliderModule.php @@ -22,7 +22,7 @@ class SliderModule extends Module */ public function init(): void { - $this->migrationService->runAtPath("{KERNEL_MODULES}/slider/migrations"); + $this->migrationService->runAtPath("{KERNEL_APP_MODULES}/slider/migrations"); $this->menuService->createItem([ "label" => "Слайдер", diff --git a/kernel/modules/slider/controllers/SliderController.php b/kernel/app_modules/slider/controllers/SliderController.php similarity index 93% rename from kernel/modules/slider/controllers/SliderController.php rename to kernel/app_modules/slider/controllers/SliderController.php index ca60934..70617a6 100644 --- a/kernel/modules/slider/controllers/SliderController.php +++ b/kernel/app_modules/slider/controllers/SliderController.php @@ -1,11 +1,11 @@ group(["prefix" => "admin"], function (CgRouteCollector $router) { + App::$collector->group(["before" => "auth"], function (RouteCollector $router) { + App::$collector->group(["prefix" => "slider"], function (CGRouteCollector $router) { + App::$collector->get('/', [\kernel\app_modules\slider\controllers\SliderController::class, 'actionIndex']); + App::$collector->get('/page/{page_number}', [\kernel\app_modules\slider\controllers\SliderController::class, 'actionIndex']); + App::$collector->get('/create', [\kernel\app_modules\slider\controllers\SliderController::class, 'actionCreate']); + App::$collector->post("/", [\kernel\app_modules\slider\controllers\SliderController::class, 'actionAdd']); + App::$collector->get('/view/{id}', [\kernel\app_modules\slider\controllers\SliderController::class, 'actionView']); + App::$collector->any('/update/{id}', [\kernel\app_modules\slider\controllers\SliderController::class, 'actionUpdate']); + App::$collector->any("/edit/{id}", [\kernel\app_modules\slider\controllers\SliderController::class, 'actionEdit']); + App::$collector->get('/delete/{id}', [\kernel\app_modules\slider\controllers\SliderController::class, 'actionDelete']); + }); + }); +}); \ No newline at end of file diff --git a/kernel/modules/slider/services/SliderService.php b/kernel/app_modules/slider/services/SliderService.php similarity index 91% rename from kernel/modules/slider/services/SliderService.php rename to kernel/app_modules/slider/services/SliderService.php index cdbf335..1298ba8 100644 --- a/kernel/modules/slider/services/SliderService.php +++ b/kernel/app_modules/slider/services/SliderService.php @@ -1,8 +1,8 @@ beginForm(isset($model) ? "/admin/slider/edit/" . $model->id : "/admin/slider", 'multipart/form-data'); diff --git a/kernel/modules/slider/views/index.php b/kernel/app_modules/slider/views/index.php similarity index 95% rename from kernel/modules/slider/views/index.php rename to kernel/app_modules/slider/views/index.php index 1952757..409ef5c 100644 --- a/kernel/modules/slider/views/index.php +++ b/kernel/app_modules/slider/views/index.php @@ -3,7 +3,7 @@ * @var int $page_number */ -use kernel\modules\slider\models\Slider; +use kernel\app_modules\slider\models\Slider; use Itguild\EloquentTable\EloquentDataProvider; use Itguild\EloquentTable\ListEloquentTable; use kernel\app_modules\photo\models\Photo; diff --git a/kernel/modules/slider/views/view.php b/kernel/app_modules/slider/views/view.php similarity index 90% rename from kernel/modules/slider/views/view.php rename to kernel/app_modules/slider/views/view.php index 39c7289..91bc9cd 100644 --- a/kernel/modules/slider/views/view.php +++ b/kernel/app_modules/slider/views/view.php @@ -22,7 +22,7 @@ $table->beforePrint(function () use ($slider) { }); $table->rows([ 'status' => (function ($data) { - return \kernel\modules\slider\models\Slider::getStatus()[$data]; + return \kernel\app_modules\slider\models\Slider::getStatus()[$data]; }) ]); $table->create(); diff --git a/kernel/modules/slider/routs/slider.php b/kernel/modules/slider/routs/slider.php deleted file mode 100644 index 703138a..0000000 --- a/kernel/modules/slider/routs/slider.php +++ /dev/null @@ -1,20 +0,0 @@ -group(["prefix" => "admin"], function (CgRouteCollector $router) { - App::$collector->group(["before" => "auth"], function (RouteCollector $router) { - App::$collector->group(["prefix" => "slider"], function (CGRouteCollector $router) { - App::$collector->get('/', [\kernel\modules\slider\controllers\SliderController::class, 'actionIndex']); - App::$collector->get('/page/{page_number}', [\kernel\modules\slider\controllers\SliderController::class, 'actionIndex']); - App::$collector->get('/create', [\kernel\modules\slider\controllers\SliderController::class, 'actionCreate']); - App::$collector->post("/", [\kernel\modules\slider\controllers\SliderController::class, 'actionAdd']); - App::$collector->get('/view/{id}', [\kernel\modules\slider\controllers\SliderController::class, 'actionView']); - App::$collector->any('/update/{id}', [\kernel\modules\slider\controllers\SliderController::class, 'actionUpdate']); - App::$collector->any("/edit/{id}", [\kernel\modules\slider\controllers\SliderController::class, 'actionEdit']); - App::$collector->get('/delete/{id}', [\kernel\modules\slider\controllers\SliderController::class, 'actionDelete']); - }); - }); -}); \ No newline at end of file