當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Model::afterValidate方法代碼示例

本文整理匯總了PHP中yii\base\Model::afterValidate方法的典型用法代碼示例。如果您正苦於以下問題:PHP Model::afterValidate方法的具體用法?PHP Model::afterValidate怎麽用?PHP Model::afterValidate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\base\Model的用法示例。


在下文中一共展示了Model::afterValidate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: afterValidate

 /**
  * @inheritdoc
  */
 public function afterValidate()
 {
     if (!$this->dashboardPanel->validate()) {
         $this->addError(null);
     }
     parent::afterValidate();
 }
開發者ID:cornernote,項目名稱:yii2-dashboard,代碼行數:10,代碼來源:Panel.php

示例2: afterValidate

    /**
     * trigger Event Assigned on Events::CREATE_Company
     * Events Defined In auction/components/Events
     */
    public function afterValidate(){
        $this->trigger(Events::REGISTRATION);
        $message = Auction::loggerMessageFormat('Company is Successfully Validated',$this->attributes);

        Auction::info($message);
        return parent::afterValidate();
    }
開發者ID:harish-reglobbe,項目名稱:Auction,代碼行數:11,代碼來源:CompanyRegistration.php

示例3: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     $fn = DynBlockHelper::configFile($this->blockId);
     if (file_exists($fn)) {
         $this->addError('blockId', 'Такой идентификатор уже используется');
     }
 }
開發者ID:kintastish,項目名稱:mobil,代碼行數:8,代碼來源:DynamicBlockModel.php

示例4: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     $this->url = str_replace(' ', '%20', $this->url);
     if ($this->_hasParams()) {
         $this->_combineParams();
     }
 }
開發者ID:MichaelSSS,項目名稱:api-tester,代碼行數:8,代碼來源:UrlForm.php

示例5: afterValidate

 public function afterValidate()
 {
     if (!$this->hasErrors) {
         foreach ($this->getAttributes() as $attr => $file) {
             if ($file && !$file->hasError) {
                 $this->{$attr} = '@' . $file->tempName;
             } else {
                 unset($this->{$attr});
             }
         }
     }
     return parent::afterValidate();
 }
開發者ID:hotelja,項目名稱:yii2-iugu,代碼行數:13,代碼來源:AccountFiles.php

示例6: afterValidate

 public function afterValidate()
 {
     $dateObj = \yii::$app->DateComponent;
     if ($this->all_day_option_id == Types::$boolean['true']['id']) {
         $this->jsObject['allDay'] = true;
     } else {
         $this->jsObject['allDay'] = false;
     }
     $this->jsObject['start'] = $dateObj->timeStampToIsoDateTime($this->start_timestamp);
     $this->jsObject['end'] = $dateObj->timeStampToIsoDateTime($this->end_timestamp);
     $this->jsObject['className'] = sprintf('calendar-%s', $this->calendar_id);
     $this->jsObject['title'] = $this->title;
     $this->jsObject['description'] = $this->description;
     $this->jsObject['project_id'] = $this->project_id;
     $this->jsObject['calendar_id'] = $this->calendar_id;
     $this->jsObject['project_collection_title'] = '';
     $this->jsObject['editable'] = true;
     return parent::afterValidate();
 }
開發者ID:spiro-stathakis,項目名稱:projects,代碼行數:19,代碼來源:Booking.php

示例7: afterValidate

 /**
  * Nach dem Validieren wandeln wir die Ip Adressen in einen String um
  * 
  * @author KAS <kassel@weitkamper.de> 28.07.2015
  */
 public function afterValidate()
 {
     if ($this->allowFrom !== "") {
         $res = preg_split("/\\./", $this->allowFrom);
         $this->allowFrom = sprintf("%03d", $res[0]) . "." . sprintf("%03d", $res[1]) . "." . sprintf("%03d", $res[2]) . "." . sprintf("%03d", $res[3]);
     } else {
         $this->allowFrom = NULL;
     }
     //----------------------------------------------------------------------
     $res = NULL;
     // ---------------------------------------------------------------------
     if ($this->allowTo !== "") {
         $res = preg_split("/\\./", $this->allowTo);
         $this->allowTo = sprintf("%03d", $res[0]) . "." . sprintf("%03d", $res[1]) . "." . sprintf("%03d", $res[2]) . "." . sprintf("%03d", $res[3]);
     } else {
         $this->allowTo = NULL;
     }
     //----------------------------------------------------------------------
     parent::afterValidate();
 }
開發者ID:KasselR,項目名稱:yii2-kr,代碼行數:25,代碼來源:Auth.php

示例8: afterValidate

 /**
  * Validation
  */
 public function afterValidate()
 {
     $user = null;
     // Loop over enabled authclients
     foreach (Yii::$app->authClientCollection->getClients() as $authClient) {
         if ($authClient instanceof BaseFormAuth) {
             $authClient->login = $this;
             if ($authClient->auth()) {
                 $this->authClient = $authClient;
                 // Delete password after successful auth
                 $this->password = "";
                 return;
             }
         }
     }
     if ($user === null) {
         $this->addError('password', 'User or Password incorrect.');
     }
     // Delete current password value
     $this->password = "";
     parent::afterValidate();
 }
開發者ID:kreativmind,項目名稱:humhub,代碼行數:25,代碼來源:Login.php

示例9: afterValidate

 /**
  * (non-PHPdoc)
  * @see \yii\base\Model::afterValidate()
  */
 public function afterValidate()
 {
     parent::afterValidate();
     $this->password = call_user_func($this->hashCallable, $this->password);
 }
開發者ID:thinker-g,項目名稱:yii2-ishtar-gate,代碼行數:9,代碼來源:LoginForm.php

示例10: afterValidate

 public function afterValidate()
 {
     if (!$this->hasErrors()) {
         $this->ipv4 = $this->ip;
         $this->ipv4port = $this->port;
         $ip = null;
         //嘗試直接獲取ip, 優先采用直接獲得的ip
         if (isset($_SERVER['x-forwarded-for'])) {
             $ip = $_SERVER['x-forwarded-for'];
         } elseif (isset($_SERVER['x-forwarded-for'])) {
             $ip = $_SERVER['x-real-ip'];
         } else {
             $ip = Yii::$app->request->userIP;
         }
         if (!empty($ip)) {
             if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
                 $this->ipv4 = $ip;
             } elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
                 $this->ipv6 = $ip;
             }
         }
         //保證如果為空就設置為null
         if (empty($this->ipv4) || empty($this->ipv4port)) {
             $this->ipv4 = null;
             $this->ipv4port = null;
         }
         if (empty($this->ipv6) || empty($this->ipv6port)) {
             $this->ipv6 = null;
             $this->ipv6port = null;
         }
         if (empty($this->ipv4) && empty($this->ipv6)) {
             $this->addError('ip', "no ip address");
         }
         $this->base64_peer_id = base64_encode($this->peer_id);
     }
     parent::afterValidate();
     // TODO: Change the autogenerated stub
 }
開發者ID:KKRainbow,項目名稱:ngpt_seed,代碼行數:38,代碼來源:QueryPeersForm.php

示例11: afterValidate

 /**
  * Init variables
  * @throws \yii\web\HttpException
  * @throws \yii\web\NotFoundHttpException
  */
 public function afterValidate()
 {
     parent::afterValidate();
     $this->_pathRootObject = $this->basePath . DIRECTORY_SEPARATOR . $this->folder;
     $this->_urlRootObject = $this->baseUrl . DIRECTORY_SEPARATOR . $this->folder;
     if (!is_dir($this->_pathRootObject)) {
         HttpError::the404();
     }
     $this->_pathObject = $this->_pathRootObject . DIRECTORY_SEPARATOR . $this->id;
     $this->_urlObject = $this->_urlRootObject . DIRECTORY_SEPARATOR . $this->id;
     if (!is_dir($this->_pathObject) && !FileHelper::createDirectory($this->_pathObject)) {
         HttpError::the500('Can not create directory: ' . $this->_pathObject);
     }
     $this->_pathObjectFile = $this->_pathObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->name;
     $this->_urlObjectFile = $this->_urlObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->name;
     $this->_pathObjectFileOrigin = $this->_pathObject . DIRECTORY_SEPARATOR . $this->name;
     $this->_pathObjectPlaceholder = $this->_pathRootObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
     $this->_urlObjectPlaceholder = $this->_urlRootObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
     $this->_pathObjectPlaceholderOrigin = $this->_pathRootObject . DIRECTORY_SEPARATOR . $this->placeholder;
     $this->_pathRootPlaceholder = $this->basePath . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
     $this->_urlRootPlaceholder = $this->baseUrl . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
     $this->_pathRootPlaceholderOrigin = $this->basePath . DIRECTORY_SEPARATOR . $this->placeholder;
 }
開發者ID:beowulfenator,項目名稱:yii2-dynamic-image,代碼行數:28,代碼來源:ImageIndexForm.php

示例12: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     $this->setDsn();
 }
開發者ID:fourteenmeister,項目名稱:yii2-install,代碼行數:5,代碼來源:DatabaseForm.php

示例13: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
 }
開發者ID:pumi11,項目名稱:aau,代碼行數:4,代碼來源:LoginForm.php

示例14: afterValidate

 /**
  * @inheritdoc
  */
 public function afterValidate()
 {
     parent::afterValidate();
     $this->validateOffers();
 }
開發者ID:corpsepk,項目名稱:yii2-yandex-market-yml,代碼行數:8,代碼來源:Shop.php

示例15: afterValidate

 public function afterValidate()
 {
     parent::afterValidate();
     // TODO: Change the autogenerated stub
     $this->signForm();
 }
開發者ID:merigold,項目名稱:yii2-p24,代碼行數:6,代碼來源:Przelewy24Model.php


注:本文中的yii\base\Model::afterValidate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。