Welcome Guest, Not a member yet? Register   Sign In
communication between controllers
#2

normeno,  normally you want to make your controllers pretty light (ie on actual source code/biz logic) and then create a library for the heavy lifting. That way any controller can talk to those libraries in any other controller.

You can have
Code:
$user = $this->user->get_current();
and
Code:
$this->product->get_by_id($product_id);


Also depending on what you are trying to do when working with data object's the model might be the best "shared" place for your code.
Code:
$product = $this->product_model->by_id($product_id);


Hope this helps.

Then you don't need to call controllers from controllers...

DMyers
Reply


Messages In This Thread
communication between controllers - by normeno - 09-14-2017, 02:19 PM
RE: communication between controllers - by dmyers - 09-14-2017, 02:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB