EllisLab/CodeIgniter — pull request #1457 by kwoodfriend (2012-06-11 22:11:09+00:00)
Title: Modified Form Validation class's set_rules()

Modified Form Validation class's set_rules() so it can now handle an array of rules, instead of just a string.

Makes it easy to modify a set of rules before they're passed to the set_rules() method.

Very simple example:

```
class Foobar extends CI_Controller {

public $validation_rules = array(

'id' => array(

'field' => 'id',
'label' => 'Id',
'rules' => array('trim', 'numeric', 'required')

),

...

);

public function foobaz()
{
$rules = $this->validation_rules;

unset($rules['id'][2]);

if ($this->form_validation->set_rules($rules))
{
...
}

...

}
}
```