Config form_validation file is not reachable in the controller. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Config form_validation file is not reachable in the controller. (/showthread.php?tid=49150) |
Config form_validation file is not reachable in the controller. - El Forum - 02-09-2012 [eluser]Unknown[/eluser] Hi, CI Users! I got my form_validation.php file placed in the /config directory, here is the content: Code: <?php According to the CI's manual file, it should be loaded automatically, but it doesnt. I can't even load it manually using the following code: Code: $this->config->load('form_validation'); My register.php controller file: Code: <?php I'm trying to display the errors in the view file then: Code: <?= form_error('recaptcha_response_field', '<div class="place"><div class="error">', '</div></div>'); ?> But no errors appearing, but as you can see I've set field rule to "required". When I move my form_validation.php file content to the controller, it does work great then, but I need that to stay in the configuration file. So where is my problem? Config form_validation file is not reachable in the controller. - El Forum - 02-09-2012 [eluser]deqer[/eluser] I don't think you can do that with config files. = array ( ... ) because you're overriding the originals $config array. You have to do it like this $config['register/index'] = array( ... ); |