Better/incorrect example in the user guide for "Extending Native Libraries" #1140

Closed
williamli opened this Issue Mar 7, 2012 · 1 comment

Comments

Projects
None yet
2 participants

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);
}

}

Contributor

narfbg commented Mar 7, 2012

@narfbg narfbg closed this Mar 7, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment