Esempio n. 1
0
 public function rules()
 {
     return [['_csrf', 'validateCSRF', 'one'], [['email', 'username', 'password', 'password_confirm', 'captcha'], 'trim'], [['email', 'username', 'password', 'password_confirm', 'captcha'], 'required'], ['email', 'length' => [4, 80, true], 'email'], ['username', 'length' => [3, 80, true], 'regex' => ['/^[\\w\\s\\-\\*\\@\\%\\#\\!\\?\\.\\)\\(\\+\\=\\~\\:]+$/i']], ['password', 'length' => [4, 20, true], 'regex' => ['/^[a-z\\d\\-\\_\\.]+$/i']], ['password_confirm', 'confirm' => [$this->password]], ['captcha', 'captcha' => [$this->captchaInstance->getSession()]], ['email', '!lowercase'], [['email', 'username', 'password', 'password_confirm', 'captcha'], 'removeTags'], ['username', 'validateExistsUser']];
 }
Esempio n. 2
0
 public function rules()
 {
     return [['_csrf', 'validateCSRF', 'one'], [['email', 'captcha'], 'trim'], [['email', 'captcha'], 'required'], ['email', 'length' => [4, 80, true], 'email'], ['captcha', 'length' => [null, 7, true], 'captcha' => [$this->captchaInstance->getSession()]], ['email', '!lowercase'], [['email', 'captcha'], 'removeTags'], ['email', 'validateEmail']];
 }