Welcome Guest, Not a member yet? Register   Sign In
set_value() into form_multiselect
#1

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 :


PHP Code:
echo form_dropdown('id_user'$usersset_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 $fieldstring $default ''bool $html_escape true) : string 
will become in form_helper
PHP Code:
*
* @return 
mixed
*/
function 
set_value(string $fieldstring $default ''bool $html_escape true

thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB