From 150a3fe190bbf9e0aebda617f48c767908ecadfd Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 4 Jun 2016 11:59:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BValidate=E7=B1=BB=20=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=9D=99=E6=80=81=E8=B0=83=E7=94=A8=20=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E4=BA=8E=E5=8D=95=E7=8B=AC=E7=9A=84=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E8=A7=84=E5=88=99?= 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 ed772d95..69081dab 100644 --- a/library/think/Validate.php +++ b/library/think/Validate.php @@ -11,6 +11,7 @@ namespace think; +use think\Exception; use think\Input; use think\Request; @@ -1107,4 +1108,14 @@ class Validate } return $scene; } + + public static function __callStatic($method, $params) + { + $class = new static; + if (method_exists($class, $method)) { + return call_user_func_array([$class, $method], $params); + } else { + throw new Exception(__CLASS__ . ':' . $method . ' method not exist'); + } + } }