浏览代码

Update Response

Jinhui Zhu 7 年之前
父节点
当前提交
da5ae65797
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 2 0
      Qii/Base/Controller.php
  2. 2 1
      Qii/Base/Response.php

+ 2 - 0
Qii/Base/Controller.php

@@ -77,6 +77,8 @@ abstract class Controller
         $this->request = Psr4::getInstance()->loadClass('\Qii\Request\Http');
         $this->request = Psr4::getInstance()->loadClass('\Qii\Request\Http');
         $this->controllerId = $this->request->controller;
         $this->controllerId = $this->request->controller;
         $this->actionId = $this->request->action;
         $this->actionId = $this->request->action;
+        $this->language = \Qii\Autoloader\Factory::getInstance('\Qii\Language\Loader');
+        $this->response = \Qii\Autoloader\Factory::getInstance('\Qii\Base\Response');;
         //载入model
         //载入model
         if ($this->enableDB) {
         if ($this->enableDB) {
             $this->enableDB();
             $this->enableDB();

+ 2 - 1
Qii/Base/Response.php

@@ -32,9 +32,10 @@ class Response
      * @var unknown_type
      * @var unknown_type
      */
      */
     protected $_sendHeader = false;
     protected $_sendHeader = false;
+    
 	public function __construct($data = array())
 	public function __construct($data = array())
 	{
 	{
-        $this->format = isset($data['format']) ? isset($data['format']) : FORMAT_HTML;
+        $this->format = isset($data['format']) ? isset($data['format']) : self::FORMAT_HTML;
 		$this->data = $data;
 		$this->data = $data;
 	}
 	}