slider module move to app_modules
This commit is contained in:
parent
ccd46636cf
commit
0e0bc80260
@ -22,7 +22,7 @@ class SliderModule extends Module
|
|||||||
*/
|
*/
|
||||||
public function init(): void
|
public function init(): void
|
||||||
{
|
{
|
||||||
$this->migrationService->runAtPath("{KERNEL_MODULES}/slider/migrations");
|
$this->migrationService->runAtPath("{KERNEL_APP_MODULES}/slider/migrations");
|
||||||
|
|
||||||
$this->menuService->createItem([
|
$this->menuService->createItem([
|
||||||
"label" => "Слайдер",
|
"label" => "Слайдер",
|
@ -1,11 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace kernel\modules\slider\controllers;
|
namespace kernel\app_modules\slider\controllers;
|
||||||
|
|
||||||
use kernel\helpers\Debug;
|
use kernel\helpers\Debug;
|
||||||
use kernel\modules\slider\models\forms\CreateSliderForm;
|
use kernel\app_modules\slider\models\forms\CreateSliderForm;
|
||||||
use kernel\modules\slider\models\Slider;
|
use kernel\app_modules\slider\models\Slider;
|
||||||
use kernel\modules\slider\services\SliderService;
|
use kernel\app_modules\slider\services\SliderService;
|
||||||
use Exception;
|
use Exception;
|
||||||
use JetBrains\PhpStorm\NoReturn;
|
use JetBrains\PhpStorm\NoReturn;
|
||||||
use kernel\AdminController;
|
use kernel\AdminController;
|
@ -5,8 +5,8 @@
|
|||||||
"slug": "slider",
|
"slug": "slider",
|
||||||
"type": "entity",
|
"type": "entity",
|
||||||
"description": "Slider module",
|
"description": "Slider module",
|
||||||
"module_class": "kernel\\modules\\slider\\SliderModule",
|
"module_class": "kernel\\app_modules\\slider\\SliderModule",
|
||||||
"module_class_file": "{KERNEL_MODULES}/slider/SliderModule.php",
|
"module_class_file": "{KERNEL_APP_MODULES}/slider/SliderModule.php",
|
||||||
"routs": "routs/slider.php",
|
"routs": "routs/slider.php",
|
||||||
"migration_path": "migrations",
|
"migration_path": "migrations",
|
||||||
"dependence": "menu"
|
"dependence": "menu"
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace kernel\modules\slider\models;
|
namespace kernel\app_modules\slider\models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace kernel\modules\slider\models\forms;
|
namespace kernel\app_modules\slider\models\forms;
|
||||||
|
|
||||||
use kernel\FormModel;
|
use kernel\FormModel;
|
||||||
|
|
20
kernel/app_modules/slider/routs/slider.php
Normal file
20
kernel/app_modules/slider/routs/slider.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use kernel\App;
|
||||||
|
use kernel\CgRouteCollector;
|
||||||
|
use Phroute\Phroute\RouteCollector;
|
||||||
|
|
||||||
|
App::$collector->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']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace kernel\modules\slider\services;
|
namespace kernel\app_modules\slider\services;
|
||||||
|
|
||||||
use kernel\modules\slider\models\Slider;
|
use kernel\app_modules\slider\models\Slider;
|
||||||
use kernel\helpers\Debug;
|
use kernel\helpers\Debug;
|
||||||
use kernel\helpers\Slug;
|
use kernel\helpers\Slug;
|
||||||
use kernel\modules\post\models\Post;
|
use kernel\modules\post\models\Post;
|
@ -3,7 +3,7 @@
|
|||||||
* @var Slider $slider
|
* @var Slider $slider
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use kernel\modules\slider\models\Slider;
|
use kernel\app_modules\slider\models\Slider;
|
||||||
|
|
||||||
$form = new \itguild\forms\ActiveForm();
|
$form = new \itguild\forms\ActiveForm();
|
||||||
$form->beginForm(isset($model) ? "/admin/slider/edit/" . $model->id : "/admin/slider", 'multipart/form-data');
|
$form->beginForm(isset($model) ? "/admin/slider/edit/" . $model->id : "/admin/slider", 'multipart/form-data');
|
@ -3,7 +3,7 @@
|
|||||||
* @var int $page_number
|
* @var int $page_number
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use kernel\modules\slider\models\Slider;
|
use kernel\app_modules\slider\models\Slider;
|
||||||
use Itguild\EloquentTable\EloquentDataProvider;
|
use Itguild\EloquentTable\EloquentDataProvider;
|
||||||
use Itguild\EloquentTable\ListEloquentTable;
|
use Itguild\EloquentTable\ListEloquentTable;
|
||||||
use kernel\app_modules\photo\models\Photo;
|
use kernel\app_modules\photo\models\Photo;
|
@ -22,7 +22,7 @@ $table->beforePrint(function () use ($slider) {
|
|||||||
});
|
});
|
||||||
$table->rows([
|
$table->rows([
|
||||||
'status' => (function ($data) {
|
'status' => (function ($data) {
|
||||||
return \kernel\modules\slider\models\Slider::getStatus()[$data];
|
return \kernel\app_modules\slider\models\Slider::getStatus()[$data];
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
$table->create();
|
$table->create();
|
@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use kernel\App;
|
|
||||||
use kernel\CgRouteCollector;
|
|
||||||
use Phroute\Phroute\RouteCollector;
|
|
||||||
|
|
||||||
App::$collector->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']);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue
Block a user