This commit is contained in:
2024-12-12 15:04:45 +03:00
parent 57c715807a
commit b00c005b09
7 changed files with 23 additions and 6 deletions

View File

@ -2,7 +2,9 @@
namespace kernel\console\controllers;
use kernel\App;
use kernel\console\ConsoleController;
use kernel\helpers\Debug;
class MainController extends ConsoleController
{
@ -12,4 +14,12 @@ class MainController extends ConsoleController
$this->out->r("Привет", "green");
}
public function actionHelp(): void
{
// Debug::dd(App::$collector->getData());
// foreach (App::$collector->getDescriptions() as $description){
// $this->out->r($description, "green");
// }
}
}

View File

@ -113,6 +113,7 @@ class ModuleController extends ConsoleController
'model' => ucfirst($slug),
'author' => $author,
'name' => $name,
'label' => $label,
]);
$this->out->r("Модуль $slug создан", 'green');

View File

@ -4,6 +4,7 @@ use kernel\App;
use Phroute\Phroute\RouteCollector;
App::$collector->console("hello", [\kernel\console\controllers\MainController::class, "indexAction"]);
App::$collector->console("help", [\kernel\console\controllers\MainController::class, "actionHelp"]);
App::$collector->group(["prefix" => "migration"], callback: function (RouteCollector $router){
App::$collector->console('run', [\kernel\console\controllers\MigrationController::class, 'actionRun']);