mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Fixed getting controller description, refactored a bit more
This commit is contained in:
@ -291,11 +291,11 @@ class Controller extends \yii\base\Controller
|
||||
$class = new \ReflectionClass($this);
|
||||
} else {
|
||||
$action = $this->createAction($actionID);
|
||||
$class = new \ReflectionClass($action);
|
||||
}
|
||||
|
||||
if ($action instanceof \yii\base\InlineAction) {
|
||||
$class = new \ReflectionMethod($this, $action->actionMethod);
|
||||
if ($action instanceof \yii\base\InlineAction) {
|
||||
$class = new \ReflectionMethod($this, $action->actionMethod);
|
||||
} else {
|
||||
$class = new \ReflectionClass($action);
|
||||
}
|
||||
}
|
||||
|
||||
$docLines = preg_split('~\R~', $class->getDocComment());
|
||||
@ -320,11 +320,13 @@ class Controller extends \yii\base\Controller
|
||||
if ($actionID === null) {
|
||||
$class = new \ReflectionClass($this);
|
||||
} else {
|
||||
$class = new \ReflectionClass($this->createAction($actionID));
|
||||
}
|
||||
$action = $this->createAction($actionID);
|
||||
|
||||
if ($action instanceof \yii\base\InlineAction) {
|
||||
$class = new \ReflectionMethod($this, $action->actionMethod);
|
||||
if ($action instanceof \yii\base\InlineAction) {
|
||||
$class = new \ReflectionMethod($this, $action->actionMethod);
|
||||
} else {
|
||||
$class = new \ReflectionClass($action);
|
||||
}
|
||||
}
|
||||
|
||||
$comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($class->getDocComment(), '/'))), "\r", '');
|
||||
|
||||
@ -40,7 +40,7 @@ class HelpController extends Controller
|
||||
{
|
||||
/**
|
||||
* Displays available commands or the detailed information
|
||||
* about a particular command. For example,
|
||||
* about a particular command.
|
||||
*
|
||||
* @param string $command The name of the command to show help about.
|
||||
* If not provided, all available commands will be displayed.
|
||||
|
||||
Reference in New Issue
Block a user