Yii get user’s attributes

Task: get password from user Object:

app\models\User#1(
  [id] => null
  [username] => null
  [password] => null
  ...
  [yii\db\BaseActiveRecord:_attributes] => [
    'id' => 2
    'username' => 'chigir.d.g@gmail.com'
    'password' => '$2y$13...VQ7b/TIm...sRP/8R...1111'
  ]
  ...

Implementation

$user->getAttrubute('password');

Done.

Leave a Reply

Your email address will not be published. Required fields are marked *




Enter Captcha Here :