Closed dariusj18 closed 4 years ago
Nice! I've made a couple of comments in your repo.
In general, it looks like really amazing work. Thank you!
If it weren't for the backwards-compatibility question, I'd be tempted to merge this in immediately. I'll let you respond either here or on your repo about the span1_text()
backwards compatibility issue before we decide how to land this.
span_text()
should still work, it's just that it adds the classes on render instead of on instantiation. It holds the extra modifiers in the field and uses them with the $framework->getFieldClasses()
the same as before. The unit test didn't run a render, so the class didn't get applied yet, that is why I changed the test. (This is still a slight backwards compatibility issue, though not so great as to remove the usage of span1_text()
)
I also still need to write the tests for checkboxes and radios.
Ah, my mistake. I don't think pre-render changes are a significant backwards-compatibility issue, so that's no big deal in my mind.
Love the direction you're going with this -- thanks again.
Done, merged in #574
I have been working on an extra feature to make for a different style select/checkbox/radio option similar to some other form libraries.
By having a Choice field type it makes selects, checkboxes, and radios use the same methods and allow for render time decisions. Using the methods multiple() and expanded() tells the control which element it will render.
This also solves some of the confusion of how checkbox/radio is used for single and/or multiples.
If you could look at my branch so far and advise. I also had to make a change to when
$framework->getFieldClasses
is called since the classes would not be solidified until render time.https://github.com/dariusj18/former/tree/choice