Closed paul-crashley closed 10 years ago
This is actually intended, it's designed so that if you pass an array of values without keys, it uses the value in the array for both the value and label in the options list:
$select = new Select('birth_year', array(1990, 1991, 1992));
// Should produce this...
<select name="birth_year">
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
</select>
// Pull request will give this...
<select name="birth_year">
<option value="0">1990</option>
<option value="1">1991</option>
<option value="2">1992</option>
</select>
Thanks though! If you are seeing some unexpected behavior let me know and we'll figure it out.
OK, I was passing an array with keys though, and still got the array values as the option values, instead of the array keys.
Can you paste a code sample? Would like to fix it for sure if it's a bug!
Updated the renderOptionsWithoutValues method as it was sending $label twice to the renderOption method