Ejemplo n.º 1
0
 /**
  * 创建action并返回
  * @param $fields
  */
 public static function Create($className)
 {
     $controller = AbstractFactory::create(Config::CONTROLLER(), $className);
     if (!$controller instanceof Controller) {
         throw new CheckedException("Class '{$className}' is not extends Controller !", CheckedException::CLASS_NOT_FOUND, null);
     }
     return $controller;
 }
Ejemplo n.º 2
0
 private function excuteResult(array $resultMap)
 {
     $result = null;
     try {
         $result = AbstractFactory::create(Config::RESULT(), "Result" . $resultMap['type']);
     } catch (FileException $fe) {
         if ($fe->getCode() == FileException::CLASS_FILE_NOT_FOUND) {
             throw new CheckedException("Rresult type  " . "Result" . $resultMap['type'] . " is undefined", CheckedException::RESULT_UNDEFINED, $fe);
         }
     } catch (CheckedException $ce) {
         if ($ce->getCode() == CheckedException::RESULT_UNDEFINED) {
             throw new CheckedException("Rresult type  " . "Result" . $resultMap['type'] . " is undefined", CheckedException::RESULT_UNDEFINED, $fe);
         }
     }
     $result->createResult($resultMap);
 }