blob: 2f1223e28197f08181bc7f9814dc6543455f3ff0 [file] [log] [blame]
Derek Jones8ede1a22011-10-05 13:34:52 -05001######################
2Auto-loading Resources
3######################
4
5CodeIgniter comes with an "Auto-load" feature that permits libraries,
6helpers, and models to be initialized automatically every time the
7system runs. If you need certain resources globally throughout your
8application you should consider auto-loading them for convenience.
9
10The following items can be loaded automatically:
11
Andrey Andreev16a704c2012-11-09 17:25:00 +020012- Classes found in the *libraries/* directory
13- Helper files found in the *helpers/* directory
14- Custom config files found in the *config/* directory
15- Language files found in the *system/language/* directory
16- Models found in the *models/* folder
Derek Jones8ede1a22011-10-05 13:34:52 -050017
Andrey Andreev5a519db2013-01-12 04:19:19 +020018To autoload resources, open the **application/config/autoload.php**
Andrey Andreev16a704c2012-11-09 17:25:00 +020019file and add the item you want loaded to the autoload array. You'll
20find instructions in that file corresponding to each type of item.
Derek Jones8ede1a22011-10-05 13:34:52 -050021
22.. note:: Do not include the file extension (.php) when adding items to
Andrey Andreeved86ee12014-07-11 19:48:37 +030023 the autoload array.
24
25Additionally, if you want CodeIgniter to use a `Composer <https://getcomposer.org/>`_
26auto-loader, just set ``$config['composer_autoload']`` to ``TRUE`` or
27a custom path in **application/config/config.php**.