When are the config_rules loaded for form_validation library? |
[eluser]amites[/eluser]
Hello, I'm building a model to handle multiple groups of Form_Validation rules at once pulled from config/form_validation my question is when are the rules loaded? if I try to call them before run() the array is empty, yet the run function inside form_validation doesn't show when they are loaded, they just show up within the first line of the function is there any way to populate config_rules directly? other approaches I'm not seeing? thank you, Alvin
[eluser]Pascal Kriete[/eluser]
When a config file has the same name as a library, the config array is automatically passed to the library constructor. To get them yourself you have two options. 1. Steal it from the library: Code: // Only works if the lib is loaded 2. Load it through the config library: Code: $this->config->load('form_validation', TRUE); Happy Holidays!
[eluser]amites[/eluser]
went back over what you did, the load through config makes sense, the "steal"ing version is similar to what I have going on Code: class MultiValid extends CI_Form_validation { echoes 'nope' every time after I load the form_validation library, however from the first line of run _config has been populated, I'm just wondering how I can force them to load earlier, no need to run multiple copies of an array like that (if I can avoid it) thank you for your help |
Welcome Guest, Not a member yet? Register Sign In |