[eluser]dmorin[/eluser]
How do you get the validated values from the new form validation class? For example, if I want to save the result to the database, how would I get the values for the queries? The old validation class created class vars for each field but this one doesn't seem to do that, or am I wrong?
I swear I can't find it in the manual.
Edit:
So, it looks like the preferred way is to just reference $_POST or $this->input->post() which seems odd since it destroys the original input, but regardless, might be a good thing to mention in the form_validation page of the user guide.
So my new problem is that apparently, when it repopulates $_POST with the validated data, it checks to see if that key already exists in the $_POST array. This breaks my app since I'm using a callback function to set a value in case that field doesn't exist. It seems as though if the Form_Validation class bothers to validate a field that isn't posted, it should probably repopulate a field that isn't posted.
If anyone thinks I'm doing this wrong, please let me know how you would do it. The other solution is to change this:
Code:
if (isset($_POST[$row['field']]))
{
$_POST[$row['field']] = $this->prep_for_form($row['postdata']);
}
to
Code:
//if (isset($_POST[$row['field']]))
//{
$_POST[$row['field']] = $this->prep_for_form($row['postdata']);
//}
Please let me know if you are aware of this breaking anything. Thanks.