Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

set_value() in CI3 has issues with input arrays

$
0
0
In Codeigniter 2 our forms were able to have


PHP Code:
<input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" />
<
input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" /> 
and each one would be populated from POST without an issue. With Codeigniter 3, all our forms that did that are now broken and I have to manually put in [0],[1],[2],etc for each form field's set_value(). Was this an intentional change or am I missing something that needed to be changed from CI2 to CI3?

The error
PHP Code:
A PHP Error was encountered
Severity
Notice
Message
: Array to string conversion 

I did look at the form_helper from CI2 and I saw it parsed out the values if it saw an array and returned them differently than they are being done in CI3.

Viewing all articles
Browse latest Browse all 14348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>