i would like to validate form with validator class
I am using
$this->load->library('validator'); class and
$this->validator->add_rule('first_name', 'required', 'Please enter in an first name', $this->input->post('first_name'));
$this->validator->add_rule('last_name', 'required', 'Please enter in an last name', $this->input->post('last_name'));
if ($this->validator->validate())
{
// valid
} else {
// unvalid
}
if is unvalid i woud like to show errors like "Please enter in an first name" and "Please enter in an last name". How to print this error on the front end view? I am not using form builders...
Thank you
Comments
Thank you
// from view $CI =& get_instance(); $CI->load->helper('validator');