Commit e8994064 by Carsten Brandt

improved docs about application and module namespace

fixes #3539
parent 6d4196d3
......@@ -31,7 +31,7 @@ class Module extends \yii\base\Module implements BootstrapInterface
*/
public $allowedIPs = ['127.0.0.1', '::1'];
/**
* @var string the namespace that controller classes are in.
* @inheritdoc
*/
public $controllerNamespace = 'yii\debug\controllers';
/**
......
......@@ -266,6 +266,7 @@ class BaseYii
*
* @param string $className the fully qualified class name without a leading backslash "\"
* @throws UnknownClassException if the class does not exist in the class file
* @see the [guide section on autoloading][guide-concept-autoloading].
*/
public static function autoload($className)
{
......
......@@ -81,8 +81,13 @@ abstract class Application extends Module
const STATE_END = 6;
/**
* @var string the namespace that controller classes are in. If not set,
* it will use the "app\controllers" namespace.
* @var string the namespace that controller classes are located in.
* This namespace will be used to load controller classes by prepending it to the controller
* class name.
* The default namespace is "app\controllers".
*
* @see the [guide section on autoloading][guide-concept-autoloading] to learn more about
* defining namespaces and how classes are loaded.
*/
public $controllerNamespace = 'app\\controllers';
/**
......
......@@ -86,10 +86,16 @@ class Module extends ServiceLocator
*/
public $controllerMap = [];
/**
* @var string the namespace that controller classes are in. If not set,
* it will use the "controllers" sub-namespace under the namespace of this module.
* @var string the namespace that controller classes are in.
* This namespace will be used to load controller classes by prepending it to the controller
* class name.
*
* If not set, it will use the `controllers` sub-namespace under the namespace of this module.
* For example, if the namespace of this module is "foo\bar", then the default
* controller namespace would be "foo\bar\controllers".
*
* @see the [guide section on autoloading][guide-concept-autoloading] to learn more about
* defining namespaces and how classes are loaded.
*/
public $controllerNamespace;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment