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


PHP Finder::findProfileById方法代码示例

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


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

示例1: actionShow

 /**
  * Shows user's profile.
  *
  * @param int $id
  *
  * @return \yii\web\Response
  * @throws \yii\web\NotFoundHttpException
  */
 public function actionShow($id)
 {
     $profile = $this->finder->findProfileById($id);
     if ($profile === null) {
         throw new NotFoundHttpException();
     }
     return $this->render('show', ['profile' => $profile]);
 }
开发者ID:chabberwock,项目名称:halo-dev,代码行数:16,代码来源:ProfileController.php

示例2: actionShow

 /**
  * Shows user's profile.
  * @param  integer $id
  * @return \yii\web\Response
  * @throws \yii\web\NotFoundHttpException
  */
 public function actionShow($id)
 {
     $profile = $this->finder->findProfileById($id);
     if ($profile === null) {
         throw new NotFoundHttpException();
     }
     $fi = FirmaIngeniero::find()->where(['ingeniero_id' => $profile->user_id])->one();
     return $this->render('show', ['profile' => $profile, 'fi' => $fi]);
 }
开发者ID:fernandrez,项目名称:ipcbsas,代码行数:15,代码来源:ProfileController.php

示例3: actionIndex

 public function actionIndex()
 {
     $id = Yii::$app->user->identity->id;
     $profile = $this->finder->findProfileById($id);
     if ($profile === null) {
         throw new NotFoundHttpException();
     }
     $this->view->params['profile'] = $profile;
     return $this->render('index');
 }
开发者ID:benzaiten16,项目名称:2a106c4df948a65ec7f7d840db7f8fde,代码行数:10,代码来源:SiteController.php

示例4: actionProfile

 /**
  * Shows profile settings form.
  *
  * @return string|\yii\web\Response
  */
 public function actionProfile()
 {
     $model = $this->finder->findProfileById(Yii::$app->user->identity->getId());
     $this->performAjaxValidation($model);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Your profile has been updated'));
         return $this->refresh();
     }
     return $this->render('profile', ['model' => $model]);
 }
开发者ID:AsiaWebSolution,项目名称:yii2GeneralVendor,代码行数:15,代码来源:SettingsController.php

示例5: actionShow

 /**
  * Shows user's profile.
  *
  * @param int $id
  *
  * @return \yii\web\Response
  * @throws \yii\web\NotFoundHttpException
  */
 public function actionShow($id)
 {
     $profile = $this->finder->findProfileById($id);
     $post = Post::getPostByUser($id);
     $tags = array();
     for ($i = 0; $i < count($post->getModels()); $i++) {
         array_push($tags, Post_tags::getTags($post->getModels()[$i]['post_id']));
     }
     if ($profile === null) {
         throw new NotFoundHttpException();
     }
     return $this->render('show', ['profile' => $profile, 'posts' => $post, 'tags' => $tags]);
 }
开发者ID:koakumasd,项目名称:blogsite,代码行数:21,代码来源:ProfileController.php

示例6: actionUpdate

 /**
  * Updates an existing User model.
  * If update is successful, the browser will be redirected to the 'index' page.
  * @param  integer $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $user = $this->findModel($id);
     $user->scenario = 'update';
     $profile = $this->finder->findProfileById($id);
     $r = \Yii::$app->request;
     $this->performAjaxValidation([$user, $profile]);
     if ($user->load($r->post()) && $profile->load($r->post()) && $user->save() && $profile->save()) {
         \Yii::$app->getSession()->setFlash('success', \Yii::t('user', 'User has been updated'));
         return $this->refresh();
     }
     return $this->render('update', ['user' => $user, 'profile' => $profile, 'module' => $this->module]);
 }
开发者ID:uniwizardcom,项目名称:yii2-task,代码行数:19,代码来源:AdminController.php

示例7: actionProfile

 /**
  * Shows profile settings form.
  *
  * @return string|\yii\web\Response
  */
 public function actionProfile()
 {
     $model = $this->finder->findProfileById(Yii::$app->user->identity->getId());
     if ($model == null) {
         $model = Yii::createObject(Profile::className());
         $model->link('user', Yii::$app->user->identity);
     }
     $event = $this->getProfileEvent($model);
     $this->performAjaxValidation($model);
     $this->trigger(self::EVENT_BEFORE_PROFILE_UPDATE, $event);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->getSession()->setFlash('success', Yii::t('user', 'Your profile has been updated'));
         $this->trigger(self::EVENT_AFTER_PROFILE_UPDATE, $event);
         return $this->refresh();
     }
     return $this->render('profile', ['model' => $model]);
 }
开发者ID:88c,项目名称:yii2-user,代码行数:22,代码来源:SettingsController.php


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