Form validation rule set in config file |
[eluser]jekorma[/eluser]
Hello. I know this has been discussed before here and there but here goes: The official CI documentation for using config based rule sets states: Quote:Your validation rule file will be loaded automatically and used when you call the run() function. the run function of course being Code: $this->form_validation->run() the documentation also states: Quote:In order to call a specific group you will pass its name to the run() function. For example, to call the signup rule you will do this: Code: if ($this->form_validation->run('signup') == FALSE) ... etc As far as I can see, this is simply not the case. First of all, the config file (config/form_validation.php) does NOT get auto loaded and must be manually set to load in autoload.php or in the controller. Second of all the documentation also fails to explain that rules have to be set like this: Code: $this->form_validation->set_rules($this->config->config['rule_set_name']); and then simply run in the usual manner: Code: if ($this->form_validation->run() == FALSE) ... etc this being done WITHOUT passing the rule set name parameter to run(). Can anyone tell me if they have got it working using the officially documented way? Regards, Jesper. |
Messages In This Thread |
Form validation rule set in config file - by El Forum - 01-27-2011, 09:45 AM
Form validation rule set in config file - by El Forum - 01-27-2011, 12:28 PM
Form validation rule set in config file - by El Forum - 01-28-2011, 11:09 AM
Form validation rule set in config file - by El Forum - 01-28-2011, 11:11 AM
|