EllisLab/CodeIgniter — pull request #721 by tgriesser (2011-11-29 21:38:40+00:00)
Title: Shorthand syntax for Form Validation set_rules()

Allows shorthand syntax for the array of rules passed into set_rules,
matching the syntax of setting an individual rule. Includes proposed
documentation update.

The following two methods for setting validation groups can be used:

```
$config = array(
array('username', 'Username', 'required'),
array('password', 'Password', 'required'),
array('passconf', 'Password Confirmation', 'required'),
array('email', 'Email', 'required')
);

$this->form_validation->set_rules($config);
```
or the usual:

```
$config = array(
array(
'field' => 'username',
'label' => 'Username',
'rules' => 'required'
),
array(
'field' => 'password',
'label' => 'Password',
'rules' => 'required'
),
array(
'field' => 'passconf',
'label' => 'Password Confirmation',
'rules' => 'required'
),
array(
'field' => 'email',
'label' => 'Email',
'rules' => 'required'
)
);

$this->form_validation->set_rules($config);
```