CodeIgniter Forums
User Guide: May add a note in Creating Libraries - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: User Guide: May add a note in Creating Libraries (/showthread.php?tid=6940)



User Guide: May add a note in Creating Libraries - El Forum - 03-18-2008

[eluser]Kromack[/eluser]
Here : http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html
Quote:Loading Your Sub-class

To load your sub-class you'll use the standard syntax normally used. DO NOT include your prefix. For example, to load the example above, which extends the Email class, you will use:
$this->load->library('email');

Once loaded you will use the class variable as you normally would for the class you are extending. In the case of the email class all calls will use:
$this->email->some_function();

When extending CI_Exceptions library it seems that using $this->load->library('exceptions'); produce an error :

Code:
Fatal error: Cannot redeclare class CI_Exceptions in system/libraries/Exceptions.php on line 27

This error have been reported :
Here
And here

So you may can add a note that tell to don't load manually the library when extending CI_ libraries ?

EDIT : sorry it seems to doesn't work too without the loading.