Browse Source

added namespace example to the autoload guide

tags/2.0.12
Carsten Brandt 7 years ago
parent
commit
8373228228
No known key found for this signature in database
GPG Key ID: BE4F41DE1DEEEED0
  1. 2
      docs/guide/concept-autoloading.md

2
docs/guide/concept-autoloading.md

@ -37,6 +37,8 @@ the front-end tier has a root alias `@frontend`, while the back-end tier root al
you may put the front-end classes under the namespace `frontend` while the back-end classes are under `backend`. This will
allow these classes to be autoloaded by the Yii autoloader.
To add a custom namespace to the autoloader you need to define an alias for the base directory of the namespace using [[Yii::setAlias()]].
For example to load classes in the `foo` namespace that are located in the `path/to/foo` directory you will call `Yii::setAlias('@foo', 'path/to/foo')`.
Class Map <span id="class-map"></span>
---------

Loading…
Cancel
Save