CodeIgniter Forums

Full Version: Method "CI_Validation::set_fields()" for the new version class "CI_Form_validation" of the latest version CodeIgniter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

I'm trying to migrate my old site with the old version of CodeIgniter to the latest version (2.1).

But with the validation class, I would like to know what the new method similar to old class "CI_Validation::set_fields()" for the new class "CI_Form_validation"
Tthank you

El Forum

1.5 until 1.7.2 for example.
"Note: To display errors this way you must remember to set your fields using the $this->validation->set_fields function described earlier. The errors will be turned into variables that have "_error" after your field name. For example, your "username" error will be available at:

from comparing the old and the new docs, I'd say, set_fields has gone and has merged into set_rules, which now takes 3 parameters instead of one.