03-28-2020, 01:19 AM
Hello,
I use set_value() not only for input but also for select and multiselect in "form_dropdown" and "form_multiselect", and it worked well in CI3 :
But with CI4 set_value return only string type, so it's no longer possible to use it for form_multiselect and their array value.
Do you think it would be possible to change the return type of set_value from "string" to "mixed" in order to make it possible again ?
will become in form_helper
thanks
I use set_value() not only for input but also for select and multiselect in "form_dropdown" and "form_multiselect", and it worked well in CI3 :
PHP Code:
echo form_dropdown('id_user', $users, set_value('id_user', ''));
echo form_multiselect('id_user[]', $users, (array)set_value('id_user', ''));
But with CI4 set_value return only string type, so it's no longer possible to use it for form_multiselect and their array value.
Do you think it would be possible to change the return type of set_value from "string" to "mixed" in order to make it possible again ?
PHP Code:
*
* @return string
*/
function set_value(string $field, string $default = '', bool $html_escape = true) : string
PHP Code:
*
* @return mixed
*/
function set_value(string $field, string $default = '', bool $html_escape = true)
thanks