Beispiel #1
0
 /**
  * 重定向
  * 特别: 如果 $this->redirect("http://www.sina.com");  如果只有一个参数 并且 第二个参数没有 则直接重定向
  */
 public function redirect($arg0 = null, $arg1 = null, $arg2 = null, $arg3 = null)
 {
     if (is_string($arg0) && $arg1 === null) {
         $url = $arg0;
     } else {
         $url = WF_Application_Router::Instance()->urlWithDomain($arg0, $arg1, $arg2, $arg3);
     }
     header('HTTP/1.1 301 Moved Permanently');
     header('Location: ' . $url);
     die;
 }
Beispiel #2
0
 private static function _Dispath()
 {
     // 获取HTTP  请求体和返回体
     $request = WF_Application_Request::Instance();
     $response = WF_Application_Response::Instance();
     // 路由管理器初始化
     $router = WF_Application_Router::Instance();
     // 进行路由
     $router->router($request);
     // 请求分发器
     try {
         WF_Application_Dispather::dispath($request, $response);
     } catch (Exception $ex) {
         self::$DispathError = $ex;
         // error controller show the error
         self::_dispathError();
         //log error
         self::_errorLog($ex->getMessage());
     }
     /**
      * 进行输出
      */
     $response->send();
 }
Beispiel #3
0
 /**
  * url 生成器
  * @param unknown_type $data
  * @param unknown_type $anchor
  */
 public function url($arg0 = null, $arg1 = null, $arg2 = null, $arg3 = null)
 {
     return WF_Application_Router::Instance()->url($arg0, $arg1, $arg2, $arg3);
 }