kernel update
This commit is contained in:
@ -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,25 @@ class MainController extends ConsoleController
|
||||
$this->out->r("Привет", "green");
|
||||
}
|
||||
|
||||
public function actionHelp(): void
|
||||
{
|
||||
$routs = App::$collector->getData()->getStaticRoutes();
|
||||
foreach ($routs as $rout => $data){
|
||||
$additionalInfo = $data['GET'][3];
|
||||
if (isset($additionalInfo['description']) and $additionalInfo['type'] === "console"){
|
||||
$this->out->inLine($rout . " - ", "green");
|
||||
$this->out->inLine($additionalInfo['description'], 'yellow');
|
||||
$this->out->r("");
|
||||
if (isset($additionalInfo['params'])){
|
||||
foreach ($additionalInfo['params'] as $key => $param){
|
||||
$this->out->inLine($key . " - ", "green");
|
||||
$this->out->inLine($param, 'yellow');
|
||||
$this->out->r("");
|
||||
}
|
||||
}
|
||||
$this->out->r("");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user