Ticket #607 (closed Feature Request: wontfix)
Validation , ability to add rules as array (patch attached)
| Reported by: | ae | Owned by: | - No owner - |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.2 |
| Component: | Libraries:Validation | Version: | SVN HEAD |
| Keywords: | Validation, add_rules | Cc: |
Description
It would be handy to be able to pass validation rules as an array instead of function arguments.
So instead of:
$validation->add_rules('email', 'required', 'email', 'length[1,100]');
You could use:
$rules = array('required','email','length[1,100]);
$validation->add_rules('email',$rules);
This is useful if you are creating forms dynamically or are storing validation for fields in the db etc.
Cheers
andrew
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
