This method is invoked automatically when PHP sees an unknown class.
The method will attempt to include the class file according to the following procedure:
1. Search in [[classMap]];
2. If the class is namespaced (e.g.
yii\base\Component), it will attempt
to include the file associated with the corresponding path alias
(e.g.
@yii/base/Component.php);
This autoloader allows loading classes that follow the
PSR-4 standard
and have its top-level namespace or sub-namespaces defined as path aliases.
Example: When aliases
@yii and
@yii/bootstrap are defined, classes in the
yii\bootstrap namespace
will be loaded using the
@yii/bootstrap alias which points to the directory where bootstrap extension
files are installed and all classes from other
yii namespaces will be loaded from the yii framework directory.
Also the
guide section on autoloading.