当前位置: 首页>>代码示例>>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;未经允许,请勿转载。