Welcome Guest, Not a member yet? Register   Sign In
Calling controllers from controllers
#2

[eluser]Colin Williams[/eluser]
It's really a matter of how CI was designed. A Controller is just an instance of CodeIgniter class. So, to have other controllers available to call, you need multiple instances of the entire CodeIgniter class.

Code:
include(APPPATH.'controllers/notice.php');
$this->notice = new Notice();
$this->notice->method_to_call();

What is wrong with having a library send out these notices for you? Or even a helper.

Code:
send_notices($users, $vars, $template);

If notices aren't an application resource, I don't see the need for having a Controller for them.


Messages In This Thread
Calling controllers from controllers - by El Forum - 04-10-2009, 11:29 AM
Calling controllers from controllers - by El Forum - 04-10-2009, 12:01 PM
Calling controllers from controllers - by El Forum - 04-10-2009, 12:11 PM
Calling controllers from controllers - by El Forum - 04-10-2009, 12:24 PM
Calling controllers from controllers - by El Forum - 04-10-2009, 08:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB