改进Cookie类的自动初始化 Controller类增加_initialize方法

This commit is contained in:
thinkphp
2016-07-28 16:19:58 +08:00
parent 8853b58838
commit 1b6622fd36
2 changed files with 15 additions and 5 deletions

View File

@@ -50,9 +50,7 @@ class Controller
$this->request = $request;
// 控制器初始化
if (method_exists($this, '_initialize')) {
$this->_initialize();
}
$this->_initialize();
// 前置操作方法
if ($this->beforeActionList) {
@@ -64,6 +62,11 @@ class Controller
}
}
// 初始化
protected function _initialize()
{
}
/**
* 前置操作
* @access protected
@@ -183,7 +186,7 @@ class Controller
}
}
// 是否批量验证
if($batch || $this->batchValidate){
if ($batch || $this->batchValidate) {
$v->batch(true);
}