当前位置: 首页>>代码示例>>PHP>>正文


PHP Module::param方法代码示例

本文整理汇总了PHP中App\Modules\User\Module::param方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::param方法的具体用法?PHP Module::param怎么用?PHP Module::param使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App\Modules\User\Module的用法示例。


在下文中一共展示了Module::param方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: isValidToken

 /**
  * Check if token is valid.
  *
  * @return boolean true if token is valid
  */
 public function isValidToken()
 {
     if (SecurityHelper::isValidToken($this->token, Module::param('emailWithin', 14400)) === true) {
         return ($this->_model = static::findOne(['token' => $this->token])) !== null;
     }
     return false;
 }
开发者ID:artkost,项目名称:yii2-starter-kit,代码行数:12,代码来源:UserEmail.php

示例2: run

 /**
  * Sign Up page.
  * If record will be successful created, user will be redirected to home page.
  */
 public function run()
 {
     $user = Yii::createObject($this->modelClass, ['scenario' => 'signup']);
     $profile = Yii::createObject($this->profileClass);
     $post = Yii::$app->request->post();
     if ($user->load($post) && $profile->load($post)) {
         if ($user->validate() && $profile->validate()) {
             $user->populateRelation('profile', $profile);
             if ($user->save(false)) {
                 if (Module::param('requireEmailConfirmation', false)) {
                     $this->trigger('success', new Event(['data' => Module::t('model', 'Your account has been created successfully. An email has been sent to you with detailed instructions.', ['url' => Url::to($this->resendRoute)])]));
                 } else {
                     Yii::$app->user->login($user);
                     $this->trigger('success', new Event(['data' => Module::t('model', 'Your account has been created successfully.')]));
                 }
                 return $this->controller->goHome();
             } else {
                 $this->trigger('danger', new Event(['data' => Module::t('model', 'Create account failed. Please try again later.')]));
                 return $this->controller->refresh();
             }
         } elseif (Yii::$app->request->isAjax) {
             Yii::$app->response->format = Response::FORMAT_JSON;
             return array_merge(ActiveForm::validate($user), ActiveForm::validate($profile));
         }
     }
     return $this->render(compact('user', 'profile'));
 }
开发者ID:artkost,项目名称:yii2-starter-kit,代码行数:31,代码来源:SignupAction.php

示例3: isValidToken

 /**
  * Check if token is valid.
  *
  * @return boolean true if token is valid
  */
 public function isValidToken()
 {
     if (SecurityHelper::isValidToken($this->token, Module::param('recoveryWithin', false)) === true) {
         return ($this->_user = User::findByToken($this->token, 'active')) !== null;
     }
     return false;
 }
开发者ID:artkost,项目名称:yii2-starter-kit,代码行数:12,代码来源:RecoveryConfirmation.php

示例4: sendSignUpEmail

 public static function sendSignUpEmail(Model $model)
 {
     if (Module::param('requireEmailConfirmation', false)) {
         return self::getInstance()->getMail()->compose('signup', ['model' => $model])->setTo($model->email)->setSubject(Module::t('mail', 'EMAIL_SUBJECT_SIGNUP') . ' ' . Yii::$app->name)->send();
     }
     return false;
 }
开发者ID:artkost,项目名称:yii2-starter-kit,代码行数:7,代码来源:Module.php

示例5: setDefaultStatus

 /**
  * @param int $status
  * @return $this
  */
 public function setDefaultStatus($status = self::STATUS_ACTIVE)
 {
     if (Module::param('requireEmailConfirmation', false)) {
         $status = self::STATUS_INACTIVE;
     }
     // Set default status
     if (!$this->status_id) {
         $this->status_id = $status;
     }
     return $this;
 }
开发者ID:artkost,项目名称:yii2-starter-kit,代码行数:15,代码来源:UserBase.php


注:本文中的App\Modules\User\Module::param方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。