yii\console\Controller::options PHP Method

options() public method

Child classes may override this method to specify possible options. Note that the values setting via options are not available until [[beforeAction()]] is being called.
public options ( string $actionID ) : string[]
$actionID string the action id of the current request
return string[] the names of the options valid for the action
    public function options($actionID)
    {
        // $actionId might be used in subclasses to provide options specific to action id
        return ['color', 'interactive', 'help'];
    }

Usage Example

 public function options($id)
 {
     $options = [];
     if (in_array($id, ['start', 'restart'])) {
         $options = ['fork'];
     }
     return array_merge(parent::options($id), $options);
 }
All Usage Examples Of yii\console\Controller::options