[eluser]thbt[/eluser]
I find that I'm creating a lot of callback functions just so I can have custom error messages. For example:
Code:
$this->validation->set_message("less_than_limit_1", "The must be less than your spending limit.");
$this->validation->set_message("less_than_limit_2", "This must be less than the amount of a single transaction.");
The callback functions less_than_limit_1 and less_than_limit_2 are exactly the same:
Code:
function less_than_limit_1($str,$max) {
if(!is_numeric($str)){ return false; }
return $str <= $max;
}
Obviously I'd like to not have identical callback functions with different names, just so I can have custom error messages. Any way to get around this?