How to clear password fields after validation fails?

What’s the best way to do this? Thx!

In your controller




<?php

if(!$model->validate()){ // or !$model->save() depending on what do you want to do

$model->password = "";

}

?>



use $model->password = ‘’;

instead of $model->password = "";

:) php tip and tricks, you will gain on performances :) “” try to seek for php variables