$val->error(), how do I return an error for an individual field?
$val = Validation::forge(); $val->add('email', 'Email') ->add_rule('required') ->add_rule('valid_email') ->add_rule('min_length', 3) ->add_rule('max_length', 255); if ($val->run()) { $vars = $val->validated(); echo 'okay'; exit; } else { $data['error']['email'] = $val->error('email'); var_dump($val->error('email')); $this->template->section = View::forge('sign/up'); }
It looks like you're new here. If you want to get involved, click one of these buttons!