• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MY_set_value

#1
[eluser]valuk[/eluser]
Hi, guys

I am writing my own function for set_value. But I can't figure out why should I look in validation class for function set_value. Isn't value from validation class and from POST the same? Thanks
Code:
* Grabs a value from the POST array for the specified field so you can
* re-populate an input field or textarea.  If Form Validation
* is active it retrieves the info from the validation class
function set_value($field = '', $default = '')
    {
        if (FALSE === ($OBJ =& _get_validation_object()))
        {
            if ( ! isset($_POST[$field]))
            {
                return $default;
            }

            return form_prep($_POST[$field], $field);
        }
        return form_prep($OBJ->set_value($field, $default), $field);
    }

#2
[eluser]ChrisMiller[/eluser]
The values will not be the same if you Prep the Refrence in the Form Vailidation Class read:

http://ellislab.com/codeigniter/user-gui...greference

Hope that helps you out,
- Enjoy


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.