From 6de814bd5471fcc23fe2997a93b85f2b458b0f4e Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 8 Jun 2016 18:30:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BController=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Controller.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/think/Controller.php b/library/think/Controller.php index 234989e5..a79a2335 100644 --- a/library/think/Controller.php +++ b/library/think/Controller.php @@ -42,6 +42,9 @@ class Controller */ public function __construct(Request $request = null) { + if (is_null($request)) { + $request = Request::instance(); + } $this->view = View::instance(Config::get('template'), Config::get('view_replace_str')); $this->request = $request;