CodeIgniter Forums
Could not extend the library ? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Could not extend the library ? (/thread-1785.html)



Could not extend the library ? - El Forum - 06-27-2007

[eluser]Unknown[/eluser]
I just learn CI recently and I think CI that is very cool.
But I encounter a problem .
When I want to extend the CI_Email library and always show the error message like these.

Quote:Fatal error: Class 'CI_Email' not found in C:\AppServ\www\CodeIgniter\system\application\libraries\MY_Email.php on line 3

Here is the code

Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class MY_Email extends CI_Email {

    function MY_Email()
    {
        parent::CI_Email();
    }

}

?>

Couldn't find CI_Email class ?
But I sure that's out there.

I have read the User Guide but I coundn't find anything wrong Sad
Or something I missed ?

Thanks for your reading .


Could not extend the library ? - El Forum - 06-27-2007

[eluser]Unknown[/eluser]
Reply by myself...

Because my misunderstanding I used the wrong way to load the library I extend.
I should use "$this->load->library('email');" to load MY_Email class.
But I write this "$this->load->library('my_email');"
So that will pop the error message :-S


Could not extend the library ? - El Forum - 06-27-2007

[eluser]marcoss[/eluser]
[quote author="[email protected]" date="1182953225"]Reply by myself...

Because my misunderstanding I used the wrong way to load the library I extend.
I should use "$this->load->library('email');" to load MY_Email class.
But I write this "$this->load->library('my_email');"
So that will pop the error message :-S[/quote]

Yup, because when you extend a core library you are actually adding extra functions to the existing one Wink