コード例 #1
0
ファイル: Application.php プロジェクト: restinphp/restinphp
 /**
  *
  */
 public function determineAction()
 {
     switch ($this->controllerError) {
         case IControllerError::PAGE_NOT_FOUND:
             $this->action = "pageNotFoundAction";
             break;
         case IControllerError::METHOD_NOT_ALLOWED:
             $this->action = "methodNotAllowedAction";
             break;
         default:
             $this->action = $this->router->getAction();
     }
 }
コード例 #2
0
ファイル: Request.php プロジェクト: restinphp/restinphp
 /**
  * @param IRouter $router
  */
 public function assignExpressionValues(IRouter $router)
 {
     foreach ($router->getExpressions() as $expression) {
         if ($router->getMethod() == "GET" || $router->getMethod() == "DELETE") {
             $this->get[$expression["key"]] = $this->parseValue($expression["value"]);
         } elseif ($router->getMethod() == "POST" || $router->getMethod() == "PUT") {
             $this->post[$expression["key"]] = $this->parseValue($expression["value"]);
         }
     }
 }