Skip to content

Update form_customization.rst #4365

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

Closed
wants to merge 1 commit into from
Closed

Conversation

oopsFrogs
Copy link
Contributor

In the Form chapter of Book for Symfony 2.3, we use {{ form(form) }} to render the entire form ( in contrast to {{ form_widget(form) }} for older version of Symfony ). so maybe it should use {{ form(form) }} here for consistency.

In the Form chapter of Book for Symphony 2.3, we use '{{ form(form) }}' to render the entire form ( in contrast to '{{ form_widget(form) }}' for older version of Symfony ). so maybe it should use '{{ form(form) }}' here for consistency.
@wouterj
Copy link
Member

wouterj commented Oct 26, 2014

👍

1 similar comment
@xabbuh
Copy link
Member

xabbuh commented Oct 26, 2014

👍

@@ -67,7 +67,7 @@ just one line:

.. code-block:: jinja

{{ form_widget(form) }}
{{ form(form) }}
Copy link
Member

Choose a reason for hiding this comment

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

We need to also update the PHP version below with this same change.

And I think we should show both. The nice thing about form(form) is that it renders everything, including the <form tags. But, the disadvantage is that if you didn't add a submit button when building your form, you can't add it here. So, I think both are useful. How about:

{# renders all of the fields #}
{{ form_widget(form) }}

{# renders all of the fields *and* the <form> start and end tag #}
{{ form(form) }}

What do you think?

@oopsFrogs
Copy link
Contributor Author

👍 to @weaverryan

@weaverryan
Copy link
Member

@oopsFrogs Awesome - do you want to make that change? If not, I can merge and then make the change.

Thanks!

@oopsFrogs
Copy link
Contributor Author

To @weaverryan, please make the change and merge it, since I'm a newbie for editing in the github, I've tried to add the change you mentioned but failed to find where to start, sorry!!!

@wouterj
Copy link
Member

wouterj commented Oct 31, 2014

Thanks for starting this, @oopsFrogs ! I've continued this in #4399

To add new commits to a PR, you need to add the commits to the branch of the PR. In this case, the branch is oopsFrogs:patch-2. This can be found in your fork: http://github.com/oopsFrogs/symfony-docs/tree/patch-2 In this view, you can navigate to the file, click "edit", apply the changes and commit them. Now, the PR will be updated.

For now, I've done this for you. Thanks again!

@wouterj wouterj closed this Oct 31, 2014
weaverryan added a commit that referenced this pull request Nov 20, 2014
…opsFrogs, WouterJ)

This PR was merged into the 2.3 branch.

Discussion
----------

Explain form() and form_widget() in form customization

Continues #4365

| Q   | A
| --- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets | -

Original PR description:

> In the Form chapter of Book for Symfony 2.3, we use `{{ form(form) }}` to render the entire form ( in contrast to `{{ form_widget(form) }}` for older version of Symfony ). so maybe it should use `{{ form(form) }}` here for consistency.

Commits
-------

0086c5e Applied suggestion by Ryan
d653ff4 Update form_customization.rst
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