validation - How can I use CodeIgniter's set_value for a field that's an array? -


I have a "dropdown label" features [] "and this is an array. When I use the form_validation of CodeIgniter I want to fill it properly using set_value, but I am not capable. Is there any input on this?

CodeIgniter 1.7.2 has the set_value implementation to see the source:

  / ** * Get value from a form * * A form field With that value Allows to recapitulate which it was presented, or, if that value is not present, then default * * @ login public * * the name of the ultimate string field * @param string * @Return Worth * / function set_value ( $ Field = '', $ default = '') {if (! Isset ($ this- & gt; _field_data [$ field])) {return $ default;} $ this-> _field_data [$ field] [' Return to postdata;}  

Note that this does not support arrays. On the other hand, the set_select of the codeignit Supports arrays in:

  // --------------------------- --- -------------------------------------- ** ** Choose Set * Enables * Bridge -Down lists can be set to the value * Error * * @ Entry Public * @ Ultimate String * @ Ultimate String * @ Return String * / Function Set_satch ($ Field = '', selected values ​​in $ value status) = '', $ Default = FALSE) (if (! Isset ($ this-> _field_data [$ field]) or! Isset ($ this-> _field_data [$ field] ['postdata'])) {if ($ default === correct and count ($ this-> _field_data) === 0) {Return 'selected = "Selected" '; } Return ''; } $ Field = $ this- & gt; _field_data [$ field] ['PostData']; If (is_array ($ fields)) {if (! In_array ($ value, $ field)) {return ''; }} And {if (($ field == 'OR $ value ==' ') or ($ field! = $ Value)) {return' '; }} Return 'selected = "selected"'; }  

Comments