Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User extends ActiveRecord implements \yii\web\IdentityInterface
- {
- // Other code goes here...
- public function getFullname()
- {
- $profile = Profile::find()->where(['user_id'=>$this->id])->one();
- if ($profile !==null)
- return $profile->fullname;
- return false;
- }
- }
- Yii::$app->user->identity->fullname;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement