Config file form validation rule groups: doesn't work with controller in sub-folder? |
[eluser]aidehua[/eluser]
I am trying to use a rule group to set form validation rules in my form_validation config file. I want the rules to be called automatically based on the Controller class name and function - as described under "Associating a Controller Function with a Rule Group" in the user guide. The class is called Content. The function is called edit_page(). However, my Controller file (content.php) lives in a sub-folder (/application/controllers/admin/content.php). According the user guide: Quote:When a rule group is named identically to a controller class/function it will be used automatically when the run() function is invoked from that class/function. But should I include the sub-folder name as well? I tried both Code: $config = array( and Code: $config = array( Neither of them causes the rules to be loaded automatically when I run the form_validation like this in the controller: Code: if ($this->form_validation->run() == FALSE): On the other hand, if I do Code: $config = array( and then call the rules explicitly in the controller like this: Code: if ($this->form_validation->run('pageedit') == FALSE): it works fine. Is it possible to use the automatic-rule-loading feature when your class is in a Controller in sub-folder? If so, what should you put in the array - 'subfolder/class/function' or 'class/function'? And since I've tried both - what might I be doing wrong? |
Messages In This Thread |
Config file form validation rule groups: doesn't work with controller in sub-folder? - by El Forum - 01-17-2010, 08:52 AM
Config file form validation rule groups: doesn't work with controller in sub-folder? - by El Forum - 05-25-2010, 04:09 PM
Config file form validation rule groups: doesn't work with controller in sub-folder? - by El Forum - 05-26-2010, 12:36 AM
Config file form validation rule groups: doesn't work with controller in sub-folder? - by El Forum - 07-20-2010, 02:15 PM
|