setAction(); #always validate presence of username $this->validates_presence_of('username'); #validate uniqueness of username when creating a new user $this->validates_uniqueness_of('username',array('on'=>'create')); #validate length of username (minimum) $this->validates_length_of('username',array('min'=>3)); #validate length of username (maximum) $this->validates_length_of('username',array('max'=>50)); #validate presence of password $this->validates_presence_of('password'); #validate presence of email $this->validates_presence_of('email'); #validate uniqueness of email when creating a new user $this->validates_uniqueness_of('email',array('on'=>'create')); #validate format of email $this->validates_format_of('email',VALID_EMAIL); #if there were errors, return false $errors = $this->invalidFields(); return (count($errors) == 0); } } ?>