/** * Action for the module, finds the appropriate module and passes the request handling on * @return mixed */ public function m($request = null) { if (!$request) { $request = $this->owner->request; } if ($request) { $response = ModuleAsController::module_controller_for_request($this->owner, $request); if ($response) { return $response; } } return $this->owner->redirect($this->owner->Link()); }
public function forTemplate() { $controller = ModuleAsController::controller_for($this); //backwards compatibility support for Modules directly handling actions if ($controller instanceof ModuleController) { $controller->setRequest(Controller::curr()->getRequest()); $controller->setFailover($this); } return $controller->renderWith(array_reverse(ClassInfo::ancestry($this->class))); }