Welcome Guest, Not a member yet? Register   Sign In
Form validation config & dynamic

Is there a specific reason why you want to use the config file? Since you only have one validation rule in the config file, why not move it into the setConfigValidations() function?

Adding it before, or after, the switch would set that rule each time, and you can build the rest dynamically as you already doing.

PHP Code:
private function setConfigValidations($page) {


   switch($page) {
       case 'tickets':
           $tickets $this->config->item('tb_tickets');
(array_keys($tickets) as $ticket) {
                   $this->form_validation->set_rules($this->config->item('tb_tickets_name_form_prefix').$ticket'lang:'.$tickets[$ticket]['name'], 'trim|required|is_ticket|minimum|maximum');


Messages In This Thread
Form validation config & dynamic - by BABYpanda - 03-17-2015, 12:03 PM
RE: Form validation config & dynamic - by silentium - 03-17-2015, 07:49 PM

Theme © iAndrew 2016 - Forum software by © MyBB