From f1a02a74b37612ee51f65e6dc6357d0ea48ebff8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 20 Dec 2015 10:59:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/controller.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/think/controller.php b/library/think/controller.php index 35b44194..ca3aaeab 100644 --- a/library/think/controller.php +++ b/library/think/controller.php @@ -36,9 +36,8 @@ class Controller } // 前置操作方法 // 支持 ['action1','action2'] 或者 ['action1'=>['only'=>'index'],'action2'=>['except'=>'login']] - $list = $this->beforeActionList; - if ($list) { - foreach ($list as $method => $options) { + if ($this->beforeActionList) { + foreach ($this->beforeActionList as $method => $options) { is_numeric($method) ? $this->beforeAction($options) : $this->beforeAction($method, $options);