mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-11 19:20:01 +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);
|
$class = new \ReflectionClass($this);
|
||||||
} else {
|
} else {
|
||||||
$action = $this->createAction($actionID);
|
$action = $this->createAction($actionID);
|
||||||
$class = new \ReflectionClass($action);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action instanceof \yii\base\InlineAction) {
|
if ($action instanceof \yii\base\InlineAction) {
|
||||||
$class = new \ReflectionMethod($this, $action->actionMethod);
|
$class = new \ReflectionMethod($this, $action->actionMethod);
|
||||||
|
} else {
|
||||||
|
$class = new \ReflectionClass($action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$docLines = preg_split('~\R~', $class->getDocComment());
|
$docLines = preg_split('~\R~', $class->getDocComment());
|
||||||
@@ -320,11 +320,13 @@ class Controller extends \yii\base\Controller
|
|||||||
if ($actionID === null) {
|
if ($actionID === null) {
|
||||||
$class = new \ReflectionClass($this);
|
$class = new \ReflectionClass($this);
|
||||||
} else {
|
} else {
|
||||||
$class = new \ReflectionClass($this->createAction($actionID));
|
$action = $this->createAction($actionID);
|
||||||
}
|
|
||||||
|
|
||||||
if ($action instanceof \yii\base\InlineAction) {
|
if ($action instanceof \yii\base\InlineAction) {
|
||||||
$class = new \ReflectionMethod($this, $action->actionMethod);
|
$class = new \ReflectionMethod($this, $action->actionMethod);
|
||||||
|
} else {
|
||||||
|
$class = new \ReflectionClass($action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($class->getDocComment(), '/'))), "\r", '');
|
$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
|
* 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.
|
* @param string $command The name of the command to show help about.
|
||||||
* If not provided, all available commands will be displayed.
|
* If not provided, all available commands will be displayed.
|
||||||
|
|||||||
Reference in New Issue
Block a user