Welcome Guest, Not a member yet? Register   Sign In
Call another controller inside action?
#1

[eluser]tkrop[/eluser]
I'm in the process of converting a website from our custom framework to CodeIgniter. Our framework basically returns an ActionResult from every controller action, which can be converted to a string.

This is the situation:

Code:
function ControllerAction($route) {
    $subcontrollerRef = $route->object;
    $page = $route->page;
    $subpage = $route->subpage;

    $controller = ControllerFactory::getController($subcontrollerRef);
    return $controller->$page($route); //dont know if this is syntactically correct, but this is what's going on. The $page function inside the $controller var, is the 'action' name that needs to be executed/returned.
}

Can this be done with CodeIgniter?


Messages In This Thread
Call another controller inside action? - by El Forum - 03-18-2010, 10:13 AM
Call another controller inside action? - by El Forum - 08-08-2010, 08:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB