Welcome Guest, Not a member yet? Register   Sign In
Validation Collection
#6

[eluser]Michael Wales[/eluser]
I added set_fields() to that wiki page. This allows you to call the set_fields() method and it will automatically create the appropriate fields based on the key of the rules.

Example:
Code:
$rules['username'] = 'trim|required';
$this->validation->set_rules($rules);
$this->validation->set_fields(); // Establishes "Username"

You can of course, override values - example:
Code:
$rules['username'] = 'trim|required';
$rules['email'] = 'trim|required|valid_email';
$this->validation->set_rules($rules);
$fields['email'] = 'Email Address';
$this->validation->set_fields($fields); // Establishes "Username", "Email Address" was pre-set


Messages In This Thread
Validation Collection - by El Forum - 10-27-2007, 07:26 PM
Validation Collection - by El Forum - 10-28-2007, 02:01 AM
Validation Collection - by El Forum - 10-28-2007, 08:36 AM
Validation Collection - by El Forum - 12-19-2007, 10:56 AM
Validation Collection - by El Forum - 12-19-2007, 02:02 PM
Validation Collection - by El Forum - 12-19-2007, 02:47 PM
Validation Collection - by El Forum - 12-31-2007, 04:06 AM
Validation Collection - by El Forum - 12-16-2008, 03:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB