Welcome Guest, Not a member yet? Register   Sign In
Could not extend the library ?
#1

[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 .
#2

[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
#3

[eluser]marcoss[/eluser]
[quote author="R@Ndy" 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




Theme © iAndrew 2016 - Forum software by © MyBB