Codeigniter Passing Extra Parameters to Custom Validation Rule - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Codeigniter Passing Extra Parameters to Custom Validation Rule (/showthread.php?tid=68482) |
Codeigniter Passing Extra Parameters to Custom Validation Rule - sentinel - 07-17-2017 According to this documentation, how can I pass second parameter to the rule method? This is my custom rule PHP Code: public function email_exists($email, $exclude_id=NULL) and this is how i call it from controller PHP Code: $rules = [ How can I pass second parameter to email_exists method? RE: Codeigniter Passing Extra Parameters to Custom Validation Rule - skunkbad - 07-17-2017 Maybe something like this: PHP Code: $second_param = 'whatever'; RE: Codeigniter Passing Extra Parameters to Custom Validation Rule - sentinel - 07-17-2017 (07-17-2017, 11:07 AM)skunkbad Wrote: Maybe something like this: It works. Thanks a lot sir. |