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

Fix docs after choice form type refactor #5755

Closed
wants to merge 1 commit into from
Closed

Fix docs after choice form type refactor #5755

wants to merge 1 commit into from

Conversation

aivus
Copy link
Contributor

@aivus aivus commented Oct 5, 2015

@@ -110,11 +110,12 @@ choice_label
The ``choice_label`` option was introduced in Symfony 2.7. Prior to Symfony
2.7, it was called ``property`` (which has the same functionality).

**type**: ``string``
**type**: ``string`` or a Closure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather write string|Closure instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly (see my comment below)

@xabbuh
Copy link
Member

xabbuh commented Oct 7, 2015

You can now also pass callables to the choice_name, choice_value, choice_attr and preferred_choices options. Can you please also describe the arguments that are passed to the callables for each option?

Furthermore, you can also pass any Traversable object, a property path or null to these options.

I think we should also add a versionadded directive to each of these options which explains what has changed in Symfony 2.8 (this could be the same text for all options).

@aivus I know this seems like a lot of work, but I think it can be done for one option and then duplicated for the others accordingly. Do you think you can make these changes?

@weaverryan
Copy link
Member

I believe this is also related to #5847. I mention that because we need to make these updates all at once, to make sure we've covered everything and done it correctly.

@weaverryan
Copy link
Member

Thanks @aivus! I've included your commits in #5876, which will be merge soon.

@weaverryan weaverryan closed this Nov 8, 2015
@aivus aivus deleted the patch-1 branch November 10, 2015 08:13
weaverryan added a commit that referenced this pull request Nov 11, 2015
…weaverryan)

This PR was submitted for the 2.8 branch but it was merged into the 2.7 branch instead (closes #5876).

Discussion
----------

Symfony 2.7 Form choice option update

Hi guys!

This replaces #5755 #5847 and should close #5179 (or at least covers most things).

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | yes
| Applies to    | 2.7+
| Fixed tickets | #5179

This is a big change, and I rewrote a lot. If you have time to review, I think it's best to read the published version up platform.sh and check the code for validity. You can see the code in a project that inspired all the examples here: https://github.com/weaverryan/form_choices/tree/finished.

Commits
-------

b55d170 typo!
70f5e85 tweaks thanks to comments
0ad7b18 fixing wrong image name
69fc3c3 removing scaling on images
a2ad990 fixing bad reference
7aa4106 Completely re-working all the choice docs, including screenshots - for 2.7 changes
79c905c changing option order - choice_name and choice_value seem like edge cases
68725e8 Fixed preferred choices example
e2dea88 Fixed linebreaking
889f123 Added choices_as_values description [amend]
e1f583b Added choices_as_values description
d3cf004 Added choice_loader basics
3763f71 Added basic choice type changes
fd35e21 Fix docs related with choice form type refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants