EllisLab/CodeIgniter — pull request #1461 by kwoodfriend (2012-06-12 15:48:11+00:00)
Title: Modified Form Validation class's set_rules()

Reposted from https://github.com/EllisLab/CodeIgniter/pull/1457.

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]);

$this->form_validation->set_rules($rules);

...

}
}
```