@@ -19,8 +19,9 @@ CodeIgniter4 Autoloader
1919
2020CodeIgniter provides a very flexible autoloader that can be used with very little configuration.
2121It can locate individual namespaced classes that adhere to
22- `PSR-4 <https://www.php-fig.org/psr/psr-4/ >`_ autoloading
23- directory structures.
22+ `PSR-4 `_ autoloading directory structures.
23+
24+ .. _PSR-4 : https://www.php-fig.org/psr/psr-4/
2425
2526The autoloader works great by itself, but can also work with other autoloaders, like
2627`Composer <https://getcomposer.org >`_, or even your own custom autoloaders, if needed.
@@ -49,16 +50,23 @@ arrays: one for the classmap, and one for PSR-4 compatible namespaces.
4950Namespaces
5051==========
5152
52- The recommended method for organizing your classes is to create one or more namespaces for your
53- application's files. This is most important for any business-logic related classes, entity classes,
54- etc. The ``$psr4 `` array in the configuration file allows you to map the namespace to the directory
53+ The recommended method for organizing your classes is to create one or more namespaces
54+ for your application's files.
55+
56+ The ``$psr4 `` array in the configuration file allows you to map the namespace to the directory
5557those classes can be found in:
5658
5759.. literalinclude :: autoloader/001.php
5860
5961The key of each row is the namespace itself. This does not need a trailing back slash.
6062The value is the location to the directory the classes can be found in.
6163
64+ By default, the namespace ``App `` is located in the **app ** directory, and the
65+ namespace ``Config `` is located in the ``app/Config `` directory.
66+
67+ If you create class files in the locations and according to `PSR-4 `_, the autoloader
68+ will autoload them.
69+
6270.. _confirming-namespaces :
6371
6472Confirming Namespaces
@@ -119,9 +127,8 @@ You will need to modify any existing files that are referencing the current name
119127Classmap
120128========
121129
122- The classmap is used extensively by CodeIgniter to eke the last ounces of performance out of the system
123- by not hitting the file-system with extra ``is_file() `` calls. You can use the classmap to link to
124- third-party libraries that are not namespaced:
130+ If you use third-party libraries that are not Composer packages and are not namespaced,
131+ you can load those classes using the classmap:
125132
126133.. literalinclude :: autoloader/003.php
127134
0 commit comments