This commit is contained in:
2025-06-18 14:50:18 +03:00
parent a64ed080bb
commit 4c716a8a8c
160 changed files with 6786 additions and 23 deletions

View File

@ -119,4 +119,48 @@ 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');
}
}