public function actionIndex()
 {
     if (!Yii::$app->user->isGuest) {
         $user = User::findOne(['id' => Yii::$app->user->id]);
         return $this->render('index', ['user' => $user]);
     }
 }
Exemple #2
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = User::findByUsername($this->username);
     }
     return $this->_user;
 }
Exemple #3
0
 /**
  * Simply saves the given instance
  *
  * @param  User $instance
  *
  * @return  boolean Success
  */
 public function save(User $instance)
 {
     return $instance->save();
 }
Exemple #4
0
 static function findFromEmail($email)
 {
     $user = User::where('email', '=', $email)->first();
     return $user;
 }