• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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