php - Codeigniter - adding multiple custom validation -
is possible add 2 or more custom validation functions using same field?
$this->form_validation->set_rules('myfield', 'my field','required|my_method1|my_method2');
eg. my_method1 check string format , my_method2 check existence of string in database.
seems first method works , second 1 ignored. because i'm using same parameter both functions?
thanks.
you can!
in each my_method_n($x)
function, must inform them prefix name callback_
, instance: callback_my_function1|callback_my_function2
.
take @ question explains how can use multiple callback functions , syntax in manual.
Comments
Post a Comment