![]() |
CI_Form_validation's set_value function - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: CI_Form_validation's set_value function (/showthread.php?tid=42354) |
CI_Form_validation's set_value function - El Forum - 06-05-2011 [eluser]Unknown[/eluser] I just realized that this function changed in CI 2.0, vis-a-vis 1.7.3. Code: function set_value($field = '', $default = '') The part where the function checks whether the value is an array and then performs an array_shift leads me to wonder if CI is trying to do too much. I usually use this function instead of the global set_value to obtain the POST data that is not form_prepped. I can see this may make things easier for some coders who can repeatedly call set_value when repopulating form elements, but in other cases, whenever you call this function, your underlying data permanently changes! Also, I would prefer access to the submitted array rather than receiving popped values off it. I know I can work around this either by accessing _field_data directly (ugly) or extending the class and the function. But I just want to point out that this change is a step in the wrong direction IMO... |