v0.1.10
This commit is contained in:
@@ -49,6 +49,9 @@ class AdminConsoleController extends ConsoleController
|
||||
$out = $this->migrationService->runAtPath("kernel/modules/secure/migrations");
|
||||
$this->out->r("create secret_code table", "green");
|
||||
|
||||
$out = $this->migrationService->runAtPath("kernel/modules/notification/migrations");
|
||||
$this->out->r("create notification table", "green");
|
||||
|
||||
$this->optionService->createFromParams(
|
||||
key: "admin_theme_paths",
|
||||
value: "{\"paths\": [\"{KERNEL_ADMIN_THEMES}\", \"{APP}/admin_themes\"]}",
|
||||
@@ -170,6 +173,13 @@ class AdminConsoleController extends ConsoleController
|
||||
]);
|
||||
$this->out->r("create item menu option", "green");
|
||||
|
||||
$this->menuService->createItem([
|
||||
"label" => "Уведомления",
|
||||
"url" => "/admin/notification",
|
||||
"slug" => "notification"
|
||||
]);
|
||||
$this->out->r("create notification option", "green");
|
||||
|
||||
$user = new CreateUserForm();
|
||||
$user->load([
|
||||
'username' => 'admin',
|
||||
|
@@ -119,48 +119,4 @@ class ModuleController extends ConsoleController
|
||||
$this->out->r("Модуль $slug создан", 'green');
|
||||
}
|
||||
|
||||
public function actionConstructController(): void
|
||||
{
|
||||
$this->out->r("Введите slug контроллера:", 'yellow');
|
||||
$slug = substr(fgets(STDIN), 0, -1);
|
||||
$slug = strtolower($slug);
|
||||
|
||||
$this->out->r("Введите model контроллера:", 'yellow');
|
||||
$model = substr(fgets(STDIN), 0, -1);
|
||||
|
||||
$this->out->r("Введите путь контроллера:", 'yellow');
|
||||
$path = substr(fgets(STDIN), 0, -1);
|
||||
$path = strtolower($path);
|
||||
|
||||
$moduleService = new ModuleService();
|
||||
$moduleService->createController([
|
||||
'slug' => $slug,
|
||||
'model' => $model,
|
||||
], $path);
|
||||
|
||||
$this->out->r("Контроллер $slug создан", 'green');
|
||||
}
|
||||
|
||||
public function actionConstructCRUD(): void
|
||||
{
|
||||
$this->out->r("Введите slug для CRUD:", 'yellow');
|
||||
$slug = substr(fgets(STDIN), 0, -1);
|
||||
$slug = strtolower($slug);
|
||||
|
||||
$this->out->r("Введите model для CRUD:", 'yellow');
|
||||
$model = substr(fgets(STDIN), 0, -1);
|
||||
|
||||
$this->out->r("Введите путь для CRUD:", 'yellow');
|
||||
$path = substr(fgets(STDIN), 0, -1);
|
||||
$path = strtolower($path);
|
||||
|
||||
$moduleService = new ModuleService();
|
||||
$moduleService->createCRUD([
|
||||
'slug' => $slug,
|
||||
'model' => $model,
|
||||
], $path);
|
||||
|
||||
$this->out->r("CRUD $model создан", 'green');
|
||||
}
|
||||
|
||||
}
|
@@ -91,14 +91,6 @@ App::$collector->group(["prefix" => "module"], callback: function (RouteCollecto
|
||||
[\kernel\console\controllers\ModuleController::class, 'actionConstructModule'],
|
||||
additionalInfo: ['description' => 'Сгенерировать модуль']
|
||||
);
|
||||
App::$collector->console('construct/controller',
|
||||
[\kernel\console\controllers\ModuleController::class, 'actionConstructController'],
|
||||
additionalInfo: ['description' => 'Сгенерировать контроллер']
|
||||
);
|
||||
App::$collector->console('construct/crud',
|
||||
[\kernel\console\controllers\ModuleController::class, 'actionConstructCRUD'],
|
||||
additionalInfo: ['description' => 'Сгенерировать CRUD']
|
||||
);
|
||||
});
|
||||
|
||||
App::$collector->group(["prefix" => "kernel"], callback: function (RouteCollector $router){
|
||||
|
Reference in New Issue
Block a user