Answer the question
In order to leave comments, you need to log in
How to add a password to the database in Yii?
There is a form and we process this form in the controller:
public function actionCreate()
{
$model = new User;
if($_POST['user'])
$model->attributes = $_POST['user'];
$model->password = что тут делать ???
}
Answer the question
In order to leave comments, you need to log in
Obviously, use the hash function, then call $model->save() if ActiveRecord. But why are you doing it in the controller? And don't do form validation?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question