Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 1 | ###################### |
| 2 | Auto-loading Resources |
| 3 | ###################### |
| 4 | |
| 5 | CodeIgniter comes with an "Auto-load" feature that permits libraries, |
| 6 | helpers, and models to be initialized automatically every time the |
| 7 | system runs. If you need certain resources globally throughout your |
| 8 | application you should consider auto-loading them for convenience. |
| 9 | |
| 10 | The following items can be loaded automatically: |
| 11 | |
Andrey Andreev | 06e9d1d | 2012-10-11 16:31:01 +0300 | [diff] [blame] | 12 | - Classes found in the "libraries" folder |
Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 13 | - Helper files found in the "helpers" folder |
| 14 | - Custom config files found in the "config" folder |
| 15 | - Language files found in the "system/language" folder |
| 16 | - Models found in the "models" folder |
| 17 | |
| 18 | To autoload resources, open the application/config/autoload.php file and |
| 19 | add the item you want loaded to the autoload array. You'll find |
| 20 | instructions in that file corresponding to each type of item. |
| 21 | |
| 22 | .. note:: Do not include the file extension (.php) when adding items to |
| 23 | the autoload array. |