first
This commit is contained in:
@ -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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user