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


PHP Finder::findUserById方法代码示例

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


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

示例1: findModel

 /**
  * Finds the User model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  *
  * @param int $id
  *
  * @return User the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     $user = $this->finder->findUserById($id);
     if ($user === null) {
         throw new NotFoundHttpException('The requested page does not exist');
     }
     return $user;
 }
开发者ID:ketuker,项目名称:oil-palm-cultivation-thesis,代码行数:17,代码来源:AdminController.php

示例2: actionConfirm

 /**
  * Confirms user's account. If confirmation was successful logs the user and shows success message. Otherwise
  * shows error message.
  *
  * @param int    $id
  * @param string $code
  *
  * @return string
  * @throws \yii\web\HttpException
  */
 public function actionConfirm($id, $code)
 {
     $user = $this->finder->findUserById($id);
     if ($user === null || $this->module->enableConfirmation == false) {
         throw new NotFoundHttpException();
     }
     $user->attemptConfirmation($code);
     return $this->render('/message', ['title' => Yii::t('user', 'Account confirmation'), 'module' => $this->module]);
 }
开发者ID:altairsoft,项目名称:plutos,代码行数:19,代码来源:RegistrationController.php

示例3: actionConfirm

 /**
  * Attempts changing user's password.
  *
  * @param int    $id
  * @param string $code
  *
  * @return string
  * @throws \yii\web\HttpException
  */
 public function actionConfirm($id, $code)
 {
     $user = $this->finder->findUserById($id);
     if ($user === null || $this->module->emailChangeStrategy == Module::STRATEGY_INSECURE) {
         throw new NotFoundHttpException();
     }
     $user->attemptEmailChange($code);
     return $this->redirect(['account']);
 }
开发者ID:AsiaWebSolution,项目名称:yii2GeneralVendor,代码行数:18,代码来源:SettingsController.php

示例4: actionConfirm

 /**
  * Attempts changing user's email address.
  *
  * @param int    $id
  * @param string $code
  *
  * @return string
  * @throws \yii\web\HttpException
  */
 public function actionConfirm($id, $code)
 {
     $user = $this->finder->findUserById($id);
     if ($user === null || $this->module->emailChangeStrategy == Module::STRATEGY_INSECURE) {
         throw new NotFoundHttpException();
     }
     $event = $this->getUserEvent($user);
     $this->trigger(self::EVENT_BEFORE_CONFIRM, $event);
     $user->attemptEmailChange($code);
     $this->trigger(self::EVENT_AFTER_CONFIRM, $event);
     return $this->redirect(['account']);
 }
开发者ID:88c,项目名称:yii2-user,代码行数:21,代码来源:SettingsController.php

示例5: actionConfirm

 /**
  * Confirms user's account. If confirmation was successful logs the user and shows success message. Otherwise
  * shows error message.
  *
  * @param int    $id
  * @param string $code
  *
  * @return string
  * @throws \yii\web\HttpException
  */
 public function actionConfirm($id, $code)
 {
     $user = $this->finder->findUserById($id);
     $event = $this->getUserEvent($user);
     if ($user === null || $this->module->enableConfirmation == false) {
         throw new NotFoundHttpException();
     }
     $this->trigger(self::EVENT_BEFORE_CONFIRM, $event);
     $user->attemptConfirmation($code);
     $this->trigger(self::EVENT_AFTER_CONFIRM, $event);
     return $this->render('/message', ['title' => Yii::t('user', 'Account confirmation'), 'module' => $this->module]);
 }
开发者ID:kingzeus,项目名称:yii2-user,代码行数:22,代码来源:RegistrationController.php


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