Derek Jones | 8ede1a2 | 2011-10-05 13:34:52 -0500 | [diff] [blame] | 1 | ########################### |
| 2 | Using CodeIgniter Libraries |
| 3 | ########################### |
| 4 | |
| 5 | All of the available libraries are located in your system/libraries |
| 6 | folder. In most cases, to use one of these classes involves initializing |
| 7 | it within a :doc:`controller <controllers>` using the following |
| 8 | initialization function:: |
| 9 | |
| 10 | $this->load->library('class name'); |
| 11 | |
| 12 | Where class name is the name of the class you want to invoke. For |
| 13 | example, to load the form validation class you would do this:: |
| 14 | |
| 15 | $this->load->library('form_validation'); |
| 16 | |
| 17 | Once initialized you can use it as indicated in the user guide page |
| 18 | corresponding to that class. |
| 19 | |
| 20 | Additionally, multiple libraries can be loaded at the same time by |
| 21 | passing an array of libraries to the load function. |
| 22 | |
| 23 | :: |
| 24 | |
| 25 | $this->load->library(array('email', 'table')); |
| 26 | |
| 27 | Creating Your Own Libraries |
| 28 | =========================== |
| 29 | |
| 30 | Please read the section of the user guide that discusses how to :doc:`create |
| 31 | your own libraries <creating_libraries>` |