-
-
Notifications
You must be signed in to change notification settings - Fork 230
Forms: CheckboxList::getControl() returns Nette\Utils\Html object #1418
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
Conversation
|
And apparently I am still bad at this. Dammit! |
...hopefully
|
please squash it into one commit :-) |
|
Is it really needed? It makes control more complicated, just because there is an error in the annotation… |
|
@dg the + is you can use easily your own macros, which call |
|
I think it should be consistent and |
|
Primary: getControl() returned Html object because it had sense. Returning always Html object is little bit like cargo cult ;-) Creating $wrapper will lead to questions like „why other controls have no wrapper“? Because wrapper is unnecessary. Because returing Html when it has no sense is not unnecessary too. So I understand @hrach point, but better is say: „Hey, do not rely on that getControl always returns Html, look at DefaultFormRenderer and fix your macros“ than change CheckboxList and support wrong design decision. |
|
As @dg wrote this is of no value. Actual benefit would be if the markup was structured Html object so it can be walked and modified without parsing text to html and back. It would be useful if I could extract all input[type=checkbox] in CheckboxList and wrap them in something else. |
|
@dg even consistency alone by itself is a pretty good argument. That fact that you wouldn't have to write ifs around every For the same reason we shouldn't have boolean parameters that change result type of method call, and probably not even The wrapper is useless here, the |
|
I agree that it is bad to write ifs around every |
...like the rest of Nette\Forms\Controls.
Also with tests this time.