Getting write-only property: app\models\User::password

When I do this…

$field = $form->field($model, 'password');

$field->template = '{input}';

echo $field->passwordInput();

… I get the following error: "Getting write-only property: app\models\User::password"

What should I do?

Probably there is only setPassword(…) method in the Model, without getPassword(), that it is mandatory to read value to populate the input field.

You were right!

I put the following to solve the problem:

    public function getPassword()


        return '';