contributte / forms-bootstrap

👾 Bootstrap 4 + 5 forms for Nette framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Select options HTML attributes

baasha opened this issue · comments

Hi guys,
is there any chance to support options rendering attributes set via new setOptionAttribute() method (since Nette Forms 3.0.4) in the future ?

Quoted from Nette doc:

$form->addSelect('colors', 'Colors:', $colors)
	->setOptionAttribute('style:', $styles);

Renders:

<select name="colors">
	<option value="r" style="background:red">red</option>
	<option value="g" style="background:green">green</option>
	<option value="b">blue</option>
</select>

Thanks in advance.

@baasha sure, I'll add it!

@baasha PR #26 should solve it, but for now without colon or questionmark support, I need to do a bit of refactoring to use nette option generation, but for that I need to catch some time... for now if urgent U can use this branch dev-allow-option-atrtributes
but this most likely won't be merged in, on next release it will probably be supported to use it natively from nette...
most probably new release will come in next week or two.

@baasha PR #26 should solve it, but for now without colon or questionmark support, I need to do a bit of refactoring to use nette option generation, but for that I need to catch some time... for now if urgent U can use this branch dev-allow-option-atrtributes
but this most likely won't be merged in, on next release it will probably be supported to use it natively from nette...
most probably new release will come in next week or two.

Thank you, you are great. 👏
It is not urgent, I know we all have to do other things to pay bills first, but thanks anyway for your enthusiasm. 👍

@baasha #28 solves this, it's also a BC break, but I consider it more a bugfix because until now translator hasn't been used in setItems and on setPrompt check this on v0.3 (current master alias) but stable version will be released somewhere tomorrow when I make sure on my projects no problems detected...

@baasha new version released closing this, open new issue if U see something not correct!

Works like a charm. Good job, thank you.