public function actionSignup()
{
$model = new User();
if ($model->load(Yii::$app->request->post())) {
if ($model->validate()) {
$model->save();
Yii::$app->session->setFlash('signUpOk');
return $this->refresh();
}
}
return $this->render('signup', [
'model' => $model,
]);
}
class User extends ActiveRecord implements IdentityInterface
Yii::$app->session->setFlash('success', 'signUpOk');
if ($model->validate()) {
$model->save(false);
//..
}
if ($model->save()) {
//..
}