EllisLab/CodeIgniter — Issue #1140: Better/incorrect example in the user guide for "Extending Native Libraries"  
Author: williamli
Created: 2012-03-07 08:33:29+00:00
State: open

In http://codeigniter.com/user_guide/general/creating_libraries.html
You gave an example of extending the CI_Email class with the following:
class MY_Email extends CI_Email {

public function __construct()
{
parent::__construct();
}
}

It would be a lot better if you can also include the config array in the example as extending most native libraries involves passing in parameters for the construction class. In the case of CI_Email, the configurations from email.php config file is not loaded unless you do the following instead.

class MY_Email extends CI_Email
{

public function __construct($config = array())
{
parent::__construct($config);
}

}