-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
[NFR]: No way to add html attributes to Select Tag. documentation inadequate #315
Labels
new feature request
Planned Feature or New Feature Request
Comments
@zhangster how you use select tag, couse i see in documentation way to add more attributes... <?php
use Phalcon\Html\Escaper;
use Phalcon\Html\Helper\Input\Select;
$escaper = new Escaper();
$helper = new Select($escaper);
$options = [
'id' => 'carsList',
];
$result = $helper(' ', PHP_EOL, $options);
$result
->add("Ferrari", "1", ["class" => "active"])
->add("Ford", "2")
->add("Dodge", "3")
->add("Toyota", "4")
->optGroup(
'oneLabel',
[
'class' => 'form-input',
]
)
->addPlaceholder(
'Choose & Car...',
"0",
[],
true,
)
->selected("3")
;
echo $result;
//
// <select id="carsList">
// <optgroup class="form-input" label="oneLabel">
// <option value="0">Choose & Car...</option>
// <option value="1" class="active">Ferrari</option>
// <option value="2">Ford</option>
// <option value="3" selected="selected">Dodge</option>
// <option value="4">Toyota</option>
// </optgroup>
// </select>" In zep file: https://github.com/phalcon/cphalcon/blob/master/phalcon/Html/Helper/Input/Select.zep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems like a really basic feature that's missing. for instance, i can't even have a select tag with css classes since there's no way to add attributes to the tag. somehow you can add classes to other html tags? this needs to be more consistent
The text was updated successfully, but these errors were encountered: