Is it possible to pass the whole Request to another Controller from within a Controller action?
Lets say we have something like this:
The First Controller:
class Controller1 extends Page_Controller {
public static $url_handlers = array(
'$Action/$ID' => 'doStuff'
)
function doStuff($request) {
if($request->param['Action'] == 'special') {
// Pass control to my SpecialController
}
return $this;
}
}
The Special Controller
class SpecialController extends Page_Controller {
public static $url_handlers = array('$ID' => 'display');
public function display($request) {
return $this;
}
}
How can I do something like this? I've tried it with
return new SpecialController();
and $controller = new SpecialController();
return $controller->handleRequest($request);
But all I get is:
[User Warning] popCurrent called on ModelAsController controller, but it wasn't at the top of the stack
Any solutions for this?