Form_validation run() method - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: Form_validation run() method (/showthread.php?tid=61326) |
Form_validation run() method - richard.rhsr - 04-08-2015 Greetings! I've been reading the Form_validation implementation, and wondering why does the run() method return FALSE if there is not any rule set. Wouldn't the opposite (return TRUE unless some rule is not attended) be more intuitive? RE: Form_validation run() method - RobertSF - 04-08-2015 Well, I guess it could go either way. It seems to me that one reason the run() method returns FALSE when there are no validation rules is that the method in fact hasn't validated anything. Comments in the code would seem to support my theory (or wild guess). PHP Code: public function run($group = '') If you have a form you wish to process without any validation rules, you can still use the alternate style of checking for submit and then taking the values from the $_POST array. PHP Code: if ($_SERVER['REQUEST_METHOD'] == 'POST' RE: Form_validation run() method - alkarim - 04-22-2015 Well said man....didn't thought that way |