From c6dcc7a76816604823a139ac7c07d72c0a6d022f Mon Sep 17 00:00:00 2001 From: birdy0815 Date: Fri, 25 Nov 2016 19:05:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E6=9F=90=E4=B8=AA=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E7=9A=84=E9=AA=8C=E8=AF=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在做验证通用操作功能封装的时候,可以根据需要,是否启用场景验证 --- library/think/Validate.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/think/Validate.php b/library/think/Validate.php index fc38d89a..17c6ae89 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -216,6 +216,17 @@ class Validate return $this; } + /** + * 判断是否存在某个验证场景 + * @access public + * @param string $name 场景名 + * @return bool + */ + public function hasScene($name) + { + return isset($this->scene[$name]); + } + /** * 设置批量验证 * @access public