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 分享