protected function init() { $username = new Element('username'); $username->filter('trim')->validate('notempty')->validate('match', '/\\w+(\\.\\w+)?/i')->validate('min', '3')->message('notempty', 'Please enter your username')->message('alnum', 'Invalid username')->message('min', 'Invalid username'); $password = new Element('password'); $password->filter('trim')->validate('notempty')->message('notempty', 'Please enter your password')->message('match', 'Invalid username'); $this->addElements($username, $password); }
protected function init() { $forgot = new Element('email'); $forgot->filter('trim')->validate('notempty')->validate('email')->message('notempty', 'Please enter your email')->message('email', 'Invalid email address'); $this->addElement($forgot); }
private function confirm() { $password = new Element('confirm'); $password->filter('trim')->validate('notempty')->validate('alnum')->message('notempty', 'Please confirm your password')->message('alnum', 'Only letters and numbers are allowed'); $this->addelement($password); }
private function token() { $token = new Element('token'); $token->filter('trim'); $this->addElement($token); }