I am currently using the Form Validation class (on Codeigniter) and setting rules.
It works like this with two parameters (codeigniter.com/user_guide/libraries/form_validation.html):
$this->form_validation->set_rules('username', 'Username', 'callback_test[abc]');
But what about a third parameter? And a fourth...? Is it possible?
It is not official but works
Split the parameter by ','
$this->form_validation->set_rules('article_big_image','Gambar Besar','callback_check_picture[article_big_image,edit]');
function check_picture($image,$param){
$param = preg_split('/,/', $param);
$field = $param[0];
$action = $param[1];
echo $field.$action;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With