# 静态代理验证器 使用 Facade 可以很容易的对自定义验证器进行静态代理。 `application/facade/User.php` ```php <?php namespace app\facade; use think\Facade; class User extends Facade { protected static function getFacadeClass() { return 'app\validate\User'; } } ``` `application/index/controller/Index.php` ```php <?php namespace app\index\controller; use think\Controller; use app\facade\User; class Index extends Controller { public function validateTest() { $data = [ 'name' => 'xiaoyu', 'email' => 'xiaoyu@xiaoyulive.top', 'password' => 123456, 'mobile' => 18388019782 ]; if(!User::check($data)) { return User::getError(); } return '验证成功'; } } ```