mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Moved creating user to static method of the model
This commit is contained in:
@ -41,10 +41,7 @@ class SignupForm extends Model
|
||||
public function signup()
|
||||
{
|
||||
if ($this->validate()) {
|
||||
$user = User::create($this->attributes);
|
||||
if ($user->save()) {
|
||||
return $user;
|
||||
}
|
||||
return User::create($this->attributes);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user