Skip to content

[Component][Forms] add missing features introduced in 2.3 #4085

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 1 commit into from
Oct 19, 2014

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Aug 3, 2014

Q A
Doc fix? no
New docs? yes (symfony/symfony#6522)
Applies to all
Fixed tickets #2969
  • use submit() instead of bind() to manually submit a form
  • configure method and action of a form
  • render a form's start and its end separately (see the comment)
  • configure buttons (see this comment)

@weaverryan
Copy link
Member

@xabbuh Thanks for opening this. We need to keep track of what we do and don't have, and where. for example:

  • The submit() instead of bind() is covered already in cookbook/form/direct_submit.rst, but not directly in the form component
  • The method and action are covered in the form book chapter, but not (until this PR) in the component
  • The form_start and form_end are covered in the form book chapter, but not in the components
  • Using a button is mentioned in the form chapter, but we don't really talk about configuration, except for its reference documentation.

It's difficult because the form component has a significant amount of duplication, in part because we thought that we might try to make it work for both the component and framework all in one page (but I don't think that makes sense anymore). Ideally, I'd like to find a way to duplicate less.

Let me know what you think!

@xabbuh
Copy link
Member Author

xabbuh commented Aug 7, 2014

@weaverryan I absolutely agree with you when talking about duplicated documentation. My suggestion is, to first complete the documentation with this pull request (so that all the things you mentioned have been covered) and afterwards discuss how to deal with duplicated documentation separately (I opened #4100 to for this). What do you think?

@weaverryan
Copy link
Member

Yep, let's do that. You already have #4100 opened to track the duplication, so we can finish this PR, which will make sure that everything is covered and accomplished. 👍

@xabbuh
Copy link
Member Author

xabbuh commented Aug 13, 2014

Alright, I think I can manage to complete this til the end of the week.

@xabbuh
Copy link
Member Author

xabbuh commented Aug 16, 2014

When it comes to duplicated documentation, we have to talk about form_start() and form_end() again. Looking at how it is done yet, I'm not sure if it really makes sense to document it twice. In the components documentation we already have a paragraph like this in the rendering section:

That’s it! By printing form_widget(form), each field in the form is rendered, along with a label and error message (if there is one). As easy as this is, it’s not very flexible (yet). Usually, you’ll want to render each form field individually so you can control how the form looks. You’ll learn how to do that in the “Rendering a Form in a Template” section.

“Rendering a Form in a Template” directly links to the appropriate section in the book chapter.

@xabbuh
Copy link
Member Author

xabbuh commented Aug 16, 2014

For submit() I decided to not duplicate any documentation, but to link to the cookbook article from the book and from the component instead.

@xabbuh
Copy link
Member Author

xabbuh commented Sep 4, 2014

I think the features you can use with buttons are already documented in the book:

What do you think? Should we duplicate or move parts of this to the component section?


By default, a form is submitted to the same URI that rendered the form with
an HTTP POST request. This behavior can be changed using the :ref:`form-option-action`
and :ref:`form-option-method` options:
Copy link
Member

Choose a reason for hiding this comment

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

We should add one small detail here: the method option is also used by handleRequest to know if the form data should be processed.

@weaverryan
Copy link
Member

@xabbuh I agree with you! So, I think this PR is ready, except for one small comment I just left.

Thanks!

These features are:

* Use the submit() (instead of bind()) method to manually submit a
  form.
* The ability to change a form's action and method.
@xabbuh xabbuh changed the title [WIP][Component][Forms] add missing features introduced in 2.3 [Component][Forms] add missing features introduced in 2.3 Oct 19, 2014
@xabbuh
Copy link
Member Author

xabbuh commented Oct 19, 2014

@weaverryan I added a small note on it.

@weaverryan
Copy link
Member

Very-nicely written note. cheers Christian!

@weaverryan weaverryan merged commit 33f6422 into symfony:2.3 Oct 19, 2014
weaverryan added a commit that referenced this pull request Oct 19, 2014
….3 (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[Component][Forms] add missing features introduced in 2.3

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes (symfony/symfony#6522)
| Applies to    | all
| Fixed tickets | #2969

- [x] use ``submit()`` instead of ``bind()`` to manually submit a form
- [x] configure method and action of a form
- [ ] ~~render a form's start and its end separately~~ (see [the comment](#4085 (comment)))
- [ ] configure buttons

Commits
-------

33f6422 [Forms] add missing features being new in 2.3
@xabbuh xabbuh deleted the issue-2969 branch October 19, 2014 18:09
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.

3 participants