コード例 #1
0
ファイル: View.php プロジェクト: nabble/ajde
 /**
  * @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);
 }
コード例 #2
0
ファイル: Model.php プロジェクト: nabble/ajde
 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
 }