From 1f593930afcf7acb06a67bd6813650b7d2dfc48f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 24 Dec 2015 11:36:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=90=8D=E4=B8=BA=20traits\controller?= =?UTF-8?q?\jump=20=E5=86=85=E7=BD=AE=E6=94=BE=E5=85=A5=20\think\controlle?= =?UTF-8?q?r=20=E7=BB=A7=E6=89=BF=20\think\Controller=20=E5=90=8E=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8=E4=B8=8B=E9=9D=A2?= =?UTF-8?q?=E4=B8=89=E4=B8=AA=E6=96=B9=E6=B3=95=EF=BC=9A=20return=20$this-?= =?UTF-8?q?>error('=E9=94=99=E8=AF=AF');=20return=20$this->success('?= =?UTF-8?q?=E6=88=90=E5=8A=9F');=20return=20$this->redirect('index/hello')?= =?UTF-8?q?;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/controller.php | 2 ++ library/traits/controller/{response.php => jump.php} | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) rename library/traits/controller/{response.php => jump.php} (93%) diff --git a/library/think/controller.php b/library/think/controller.php index ca3aaeab..ed9a8148 100644 --- a/library/think/controller.php +++ b/library/think/controller.php @@ -12,9 +12,11 @@ namespace think; T('controller/view'); +T('controller/jump'); class Controller { + use \traits\controller\jump; use \traits\controller\view; /** diff --git a/library/traits/controller/response.php b/library/traits/controller/jump.php similarity index 93% rename from library/traits/controller/response.php rename to library/traits/controller/jump.php index c2c2367c..f1dfd0bb 100644 --- a/library/traits/controller/response.php +++ b/library/traits/controller/jump.php @@ -2,10 +2,10 @@ /** * 用法: - * T('controller/response'); + * T('controller/jump'); * class index * { - * use \traits\controller\response; + * use \traits\controller\jump; * public function index(){ * $this->error(); * $this->redirect(); @@ -14,7 +14,9 @@ */ namespace traits\controller; -trait Response +use think\Response; + +trait Jump { // 视图类实例 protected $view = null;