[eluser]daveWid[/eluser]
I want to extend the Email class, but since I have different sections of the website, I want to have different classes to handle the emails being sent out to keep everything clean.
Here is what I have
application/MY_Email.php
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Email extends CI_Email
{
public function MY_Email()
{
parent::CI_Email();
}
}
class NewEmail extends MY_Email
{
public function NewEmail()
{
parent::MY_Email();
}
public function cool_method($params)
{
// Method code here
}
}
And in my controller where I want to send the email I have this
Code:
$this->load->library('email');
$email = new NewEmail();
$email->cool_method($params);
All of this works great, but I was wondering if there was a way to load up the NewEmail class directly. Is there a way to call
Code:
$this->load->library('Newemail');
and have it autoload the CI_Email class?? I want to extend the CI_Email class without holding a reference to the base CI class with get_instance().
Thanks for any help in advance.