Skip to content
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

Add Choice field type #574

Merged
merged 3 commits into from
Jan 31, 2019
Merged

Add Choice field type #574

merged 3 commits into from
Jan 31, 2019

Conversation

dariusj18
Copy link
Contributor

Pull request has three main features, two of them related.

  1. Making Checkable's inline, stacked, and grouped methods accept boolean attributes.
  2. Add Choice field type which necessitated delaying Framework class application to render time since inline classes would not be applied the same way to checkbox/radio vs select elements.

Similar to the concept of Symphony's ChoiceType field, allows for easy runtime decisions on how to render an input.

Uses methods multiple(bool) and expanded(bool) to decide what form fields to render.

multiple: false and expanded: false = select
multiple: true and expanded: false = multiselect
multiple: false and expanded: true = radios
multiple: true and expanded: true = checkboxes

Also simplifies the provisioning of choices with a choices() method.  I would prefer to expand on this by creating ChoiceGroup and Choice objects instead of trying to interepret the developer's intent from the object passed in.
@claar
Copy link
Member

claar commented Oct 24, 2018

I do think this should likely be merged; sorry for the delay. I haven't had the time to review and test this properly.

@claar claar merged commit e68d1cc into formers:master Jan 31, 2019
claar added a commit that referenced this pull request Jan 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants