public function actionUsage($action)
    {
        $result = Yii::$app->createController($action);

        if ($result === false || !($result[0] instanceof Controller)) {
            return;
        }

        /** @var Controller $controller */
        list($controller, $actionID) = $result;
        $action = $controller->createAction($actionID);
        if ($action === null) {
            return;
        }

        $scriptName = $this->getScriptName();
        if ($action->id === $controller->defaultAction) {
            $this->stdout($scriptName . ' ' . $this->ansiFormat($controller->getUniqueId(), Console::FG_YELLOW));
        } else {
            $this->stdout($scriptName . ' ' . $this->ansiFormat($action->getUniqueId(), Console::FG_YELLOW));
        }

        foreach ($controller->getActionArgsHelp($action) as $name => $arg) {
            if ($arg['required']) {
                $this->stdout(' <' . $name . '>', Console::FG_CYAN);
            } else {
                $this->stdout(' [' . $name . ']', Console::FG_CYAN);
            }
        }

        $this->stdout("\n");
    }
public function actionUsage($action)
    {
        $result = Yii::$app->createController($action);

        if ($result === false || !($result[0] instanceof Controller)) {
            return;
        }

        
        list($controller, $actionID) = $result;
        $action = $controller->createAction($actionID);
        if ($action === null) {
            return;
        }

        $scriptName = $this->getScriptName();
        if ($action->id === $controller->defaultAction) {
            $this->stdout($scriptName . ' ' . $this->ansiFormat($controller->getUniqueId(), Console::FG_YELLOW));
        } else {
            $this->stdout($scriptName . ' ' . $this->ansiFormat($action->getUniqueId(), Console::FG_YELLOW));
        }

        foreach ($controller->getActionArgsHelp($action) as $name => $arg) {
            if ($arg['required']) {
                $this->stdout(' <' . $name . '>', Console::FG_CYAN);
            } else {
                $this->stdout(' [' . $name . ']', Console::FG_CYAN);
            }
        }

        $this->stdout("\n");
    }
public function actionUsage ( $ action ) { $ result = Yii :: $ app -> createController ( $ action ) ; if ( $ result === false || ! ( $ result [ 0 ] instanceof Controller ) ) { return ; } /** @var Controller $controller */ list ( $ controller , $ actionID ) = $ result ; $ action = $ controller -> createAction ( $ actionID ) ; if ( $ action === null ) { return ; } $ scriptName = $ this -> getScriptName ( ) ; if ( $ action -> id === $ controller -> defaultAction ) { $ this -> stdout ( $ scriptName . ' ' . $ this -> ansiFormat ( $ controller -> getUniqueId ( ) , Console :: FG_YELLOW ) ) ; } else { $ this -> stdout ( $ scriptName . ' ' . $ this -> ansiFormat ( $ action -> getUniqueId ( ) , Console :: FG_YELLOW ) ) ; } foreach ( $ controller -> getActionArgsHelp ( $ action ) as $ name => $ arg ) { if ( $ arg [ 'required' ] ) { $ this -> stdout ( ' <' . $ name . '>' , Console :: FG_CYAN ) ; } else { $ this -> stdout ( ' [' . $ name . ']' , Console :: FG_CYAN ) ; } } $ this -> stdout ( "\n" ) ; }
Displays usage information for $action.

@param string $action route to action
@since 2.0.11
Displays usage information for $action .