Пример #1
0
 /**
  * Declares the validation rules.
  */
 public function rules()
 {
     $rules = array_merge([['password', 'trim', 'except' => 'register'], ['password', 'required', 'except' => 'register'], ['password', 'authenticate', 'except' => 'register']], parent::rules());
     return $rules;
 }
Пример #2
0
 /**
  * Declares the validation rules.
  * The rules state that username and password are required,
  * and password needs to be authenticated.
  */
 public function rules()
 {
     $rules = $this->filterRules(array_merge([[['username', 'password'], 'trim'], [['username', 'password'], 'required'], ['rememberMe', 'boolean'], ['password', 'authenticate']], $this->rulesAddScenario(parent::rules(), 'reset')));
     return $rules;
 }
Пример #3
0
 /**
  * Declares the validation rules.
  * The rules state that username and password are required,
  * and password needs to be authenticated.
  */
 public function rules()
 {
     $rules = $this->filterRules(array_merge([[['username', 'email'], 'trim'], [['username', 'email'], 'default'], [['username', 'email'], 'existingIdentity'], ['email', 'email'], ['activationKey', 'trim', 'on' => ['reset', 'verify']], ['activationKey', 'default', 'on' => ['reset', 'verify']], ['activationKey', 'required', 'on' => ['reset', 'verify']], ['activationKey', 'validActivationKey', 'on' => ['reset', 'verify']]], $this->rulesAddScenario(parent::rules(), 'reset')));
     return $rules;
 }