Переглянути джерело

Update:更新相关信息

Jinhui Zhu 5 роки тому
батько
коміт
a7d42031c1

+ 3 - 0
src/Base/Controller.php

@@ -229,6 +229,9 @@ abstract class Controller
      */
     final public function dispatch($controller, $action)
     {
+        if($this->request == null) {
+            throw new \Exception(_i(1104, "\Qii\Request\Http"), __LINE__);
+        }
         $this->request->setControllerName($controller);
         $this->request->setActionName($action);
         \Qii::getInstance()->dispatcher->setRequest($this->request);

+ 7 - 7
src/Language/i18n/CN/error.php

@@ -65,13 +65,13 @@ return array(
     //类相关
     1100 => '%s参数太多,此方法只接受<font color="red">%d</font>个参数,传递了<font color="red">%d</font>个。',
     1101 => '方法<font color="red">%s</font>未定义',
-    1103 => '未找到类<font color="red">%s</font>',
-    1104 => '类名不能为空',
-    1105 => '类<font color="red">%s</font>未被实例化',
-    1106 => '调用不存在的方法:<font color="red">%s::%s</font> 参数:<font color="red">%s</font>"',
-    1107 => '%s必须扩展或继承%s类',
-    1108 => '请在你的项目下添加此控制器<font color="red">%s</font>, 并添加此方法<font color="red">%s</font>',
-    1109 => '请在你的项目下添加<font color="red">%s</font>类, 并添加此方法<font color="red">%s</font>',
+    1102 => '未找到类<font color="red">%s</font>',
+    1103 => '类名不能为空',
+    1104 => '类<font color="red">%s</font>尚未实例化',
+    1105 => '调用不存在的方法:<font color="red">%s::%s</font> 参数:<font color="red">%s</font>"',
+    1106 => '%s必须扩展或继承%s类',
+    1107 => '请在你的项目下添加此控制器<font color="red">%s</font>, 并添加此方法<font color="red">%s</font>',
+    1108 => '请在你的项目下添加<font color="red">%s</font>类, 并添加此方法<font color="red">%s</font>',
     //文件相关
     1400 => '网站配置文件%s错误',
     1401 => '目录%s不存在',

+ 3 - 3
src/Language/i18n/EN/error.php

@@ -68,9 +68,9 @@ return array(
 	1103 => 'Class name couldn\'t be NULL',
 	1104 => 'Class <font color="red">%s</font> didn\'t instance',
 	1105 => 'Call undefined method <font color="red">%s::%s</font>" with args "<font color="red">%s</font>"',
-	1107 => 'Class %s must be the extends/implements of %s',
-	1108 => 'Please write this controller<font color="red">%s</font> controller in your project, and add this method <font color="red">%s</font>',
-	1109 => 'Please write this <font color="red">%s</font> class in your project, and add this method <font color="red">%s</font>',
+	1106 => 'Class %s must be the extends/implements of %s',
+	1107 => 'Please write this controller<font color="red">%s</font> controller in your project, and add this method <font color="red">%s</font>',
+	1108 => 'Please write this <font color="red">%s</font> class in your project, and add this method <font color="red">%s</font>',
 	//file and others
 	1400 => 'Website configure file <font color="red">%s</font> error',
 	1401 => 'Dir %s does not exist',