Explorar el Código

Update Response

Jinhui Zhu hace 7 años
padre
commit
da5ae65797
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  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->controllerId = $this->request->controller;
         $this->actionId = $this->request->action;
+        $this->language = \Qii\Autoloader\Factory::getInstance('\Qii\Language\Loader');
+        $this->response = \Qii\Autoloader\Factory::getInstance('\Qii\Base\Response');;
         //载入model
         if ($this->enableDB) {
             $this->enableDB();

+ 2 - 1
Qii/Base/Response.php

@@ -32,9 +32,10 @@ class Response
      * @var unknown_type
      */
     protected $_sendHeader = false;
+    
 	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;
 	}