Skip to content

Refactor: Dynamic forms cookbook entry #2417

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

Merged
merged 2 commits into from
Apr 4, 2013
Merged

Refactor: Dynamic forms cookbook entry #2417

merged 2 commits into from
Apr 4, 2013

Conversation

weaverryan
Copy link
Member

Q A
Doc fix? yes
New docs? no
Applies to or 2.1+

The dynamic forms cookbook entry was enhanced greatly in #1842. However, it lacks some consistency now, along with a number of other issues. I've done my best here as a first pass at fixing all of this and getting this entry up to the level where it needs to be.

My goal here is to:

  1. Get any more obvious issues fixed and merge this in
  2. After, create an issue so we can track the remaining things that need to be updated. These include:
  • Simplify the first example - a subscriber is overkill, a listener is easier, and a callback is probably the best approach
  • We need to document every form event and its purpose, what its data is, etc
  • Both the FriendMessage and SportsMeetup examples aren't really completed. They leave out more detail than I like and so aren't copy-and-pastable. This is especially true of SportsMeetup, where I ran out of steam to keep going :). Ideally, all three examples would be more consistent - building up on the same example, not three different examples.
  • I think we need to spend some time on the AJAX experience that's so common when you have one form field that depends on another (i.e. user selects "Country", AJAX request is made to update the "State" field).

Thanks!

by any other subscribers or listeners because ``form.pre_set_data`` is the
first form event dispatched.
The ``FormEvents::PRE_SET_DATA`` line actually resolves to the string
``form.pre_set_data``. :class:`Symfony\\Component\\Form\\FormEvents` serves an organizational purpose. It is a centralized location
Copy link
Member

Choose a reason for hiding this comment

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

some linebreaks missing here

weaverryan added a commit that referenced this pull request Apr 4, 2013
Refactor: Dynamic forms cookbook entry
@weaverryan weaverryan merged commit d9becd2 into 2.1 Apr 4, 2013
@weaverryan weaverryan deleted the dynamic-forms branch April 4, 2013 02:17
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