This can be done by providing a third parameter when loading the library.
If the third (optional) parameter is empty, the library is usually assigned to an object with the same name as the library. For example, if the library is called Calendar, it will be assigned to a variable named $ this-> calendar.
If you prefer to set your own class names, you can pass its value to the third parameter:
$this->load->library('calendar', NULL, 'my_calendar');
$this->my_calendar
Read more in the Loader Class
Codeigniter documentation .
sotoz source
share