thinkphp中如何使用AOP切面编程快速验证我们的数据

下面由thinkphp教程栏目给大家介绍thinkphp中使用aop切面编程快速验证我们的数据,希望对需要的朋友有所帮助!

thinkphp中如何使用AOP切面编程快速验证我们的数据

thinkphp中使用AOP切面编程快速验证我们的数据

thinkphpthinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据thinkphp中如何使用AOP切面编程快速验证我们的数据

    <?php          Namespace appcommonvalidate;      use appcommoncontrollerBase;     use thinkRequest;     use thinkValidate;      class BaseValidate extends Validate     {         /**          * 基础类控制器          * @param null|array $data          * @return bool          */         public function goCheck($data = null)         {             # 当 data 不存在的时候去自动校验获取到的参数             if( is_null($data) ) {                 # 获取待验证的参数                 $data = Request::instance()->param();             }              # 进行验证             if( !$this->check($data) ) {                 (new Base())->ajaxjson(Base::error, $this->getError()); # 抛出的自定义异常             }              return true;         }

© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享