|
@@ -47,22 +47,24 @@ abstract class Request
|
|
|
$rewriteRule = \Qii::getInstance()->appConfigure(\Qii\Config\Consts::APP_SITE_METHOD);
|
|
|
$this->url = new \Qii\Request\Url($rewriteRule);
|
|
|
$this->host = IS_CLI ? '' : $_SERVER['HTTP_HOST'];
|
|
|
- $params = (array)$this->url->request->params();
|
|
|
- if (count($params) > 0) $this->params = array_merge($this->params, $params);
|
|
|
- $routeInfo = $this->url->request->getPathArgs();
|
|
|
- $controller = $this->defaultController();
|
|
|
+ $params = (array)$this->url->getParams();
|
|
|
+ if(count($params) > 0) $this->params = array_merge($this->params, $params);
|
|
|
+ $routeInfo = (array)$this->url->getPathArgs();
|
|
|
+ $controller = $this->defaultController();
|
|
|
$action = $this->defaultAction();
|
|
|
//cli 模式处理
|
|
|
if(IS_CLI) {
|
|
|
$routeInfo = $this->url->request->getCliPathArgs();
|
|
|
}
|
|
|
- if (count($routeInfo) > 1) {
|
|
|
- $action = array_pop($routeInfo);
|
|
|
- $controller = join("\\", $routeInfo);
|
|
|
- } else if (count($routeInfo) == 1 && !empty($routeInfo[0])) {
|
|
|
- $controller = $routeInfo[0];
|
|
|
- }
|
|
|
- //处理url中的数据
|
|
|
+
|
|
|
+ if(count($routeInfo) > 1)
|
|
|
+ {
|
|
|
+ $action = array_pop($routeInfo);
|
|
|
+ $controller = join("\\", $routeInfo);
|
|
|
+ }
|
|
|
+ else if(count($routeInfo) == 1 && !empty($routeInfo[0])) {
|
|
|
+ $controller = $routeInfo[0];
|
|
|
+ } //处理url中的数据
|
|
|
if (ucwords($rewriteRule) == 'Short') {
|
|
|
$this->setControllerName($controller);
|
|
|
$this->setActionName($action);
|