Extracted inline action object creation, implemented it in console controller in order to use console inline action instead of base one

This commit is contained in:
Alexander Makarov
2014-09-04 01:26:42 +04:00
parent c43b7ee8b5
commit d74e89a1ca
2 changed files with 22 additions and 2 deletions

View File

@@ -9,7 +9,6 @@ namespace yii\console;
use Yii;
use yii\base\Action;
use yii\base\InlineAction;
use yii\base\InvalidRouteException;
use yii\helpers\Console;
@@ -60,6 +59,15 @@ class Controller extends \yii\base\Controller
return $this->color === null ? Console::streamSupportsAnsiColors($stream) : $this->color;
}
/**
* @inheritdoc
* @return \yii\console\InlineAction
*/
protected function createActionObject($id, $methodName)
{
return new InlineAction($id, $this, $methodName);
}
/**
* Runs an action with the specified action ID and parameters.
* If the action ID is empty, the method will use [[defaultAction]].