-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phalcon\Forms\Element\Select::addOption(array $option) #1955
Comments
ghost
mentioned this issue
Feb 2, 2014
Fixed, could you please check? |
Much thanks @sjinks for responding to this issue. <select id="selection" name="selection" multiple="yes" size="10">
<optgroup label="0">
<option value="id">1</option>
<option value="value">Apple</option>
</optgroup>
<optgroup label="1">
<option value="2">Orange</option>
</optgroup>
<option value="2">Test String</option>
</select>
$selection = new \Phalcon\Forms\Element\Select("selection");
$selection->addOption(array('id'=>'1','value'=>'Apple'));
$selection->addOption(array('2'=>'Orange'));
$selection->addOption('Test String');
echo $selection->render(array('multiple'=>'yes','size'=>10)); // render Select element Output from: print_r($selection->getOptions());Array ( [0] => Array ( [id] => 1 [value] => Apple ) [1] => Array ( [2] => Orange ) [2] => Test String ) |
Please run php build/gen-build.php then rebuild Phalcon and try again — build/ version is not updated automatically from ext/ |
<select id="selection" name="selection" multiple="yes" size="10">
<option selected="selected" value="0">Test String</option>
<option value="2">Orange</option>
<option value="l">1</option>
<option value="value">Apple</option>
</select> Works after building from ext/ |
i have same issue with optgroup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Class: Phalcon\Forms\Element\Select
Version: : Phalcon 1.2.6
Issue: Method addOption() does not correctly render argument type Array as select option.
Output:
The text was updated successfully, but these errors were encountered: