/** * @param Ajde_Controller $controller * * @return Ajde_View */ public static function fromController(Ajde_Controller $controller) { $base = MODULE_DIR . $controller->getModule() . '/'; $action = $controller->getRoute()->getController() ? $controller->getRoute()->getController() . '/' . $controller->getAction() : $controller->getAction(); $format = $controller->hasFormat() ? $controller->getFormat() : 'html'; return new self($base, $action, $format); }
public static function extendController(Ajde_Controller $controller, $method, $arguments) { // Register getModel($name) function on Ajde_Controller if ($method === 'getModel') { if (!isset($arguments[0])) { $arguments[0] = $controller->getModule(); } return self::getModel($arguments[0]); } // TODO: if last triggered in event cueue, throw exception // throw new Ajde_Exception("Call to undefined method ".get_class($controller)."::$method()", 90006); // Now, we give other callbacks in event cueue chance to return }