Skip to content

[Forms] Fixed TextType empty_data value explanation #10743

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
Dec 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion reference/forms/types/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ These options inherit from the :doc:`FormType </reference/forms/types/form>`:
.. include:: /reference/forms/types/options/empty_data.rst.inc
:end-before: DEFAULT_PLACEHOLDER

The default value is ``''`` (the empty string).
From an HTTP perspective, submitted data is always a string or an array of strings.
So by default, the form will treat any empty string as null. If you prefer to get
an empty string, explicitly set the ``empty_data`` option to an empty string.
Copy link
Contributor

Choose a reason for hiding this comment

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

@symfony/team-symfony-docs should we care about adding a note to say this possible since 3.2 only?

Copy link
Member

Choose a reason for hiding this comment

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

Not needed because we merge in 3.4, so the minimum Symfony version already has that.


.. include:: /reference/forms/types/options/empty_data.rst.inc
:start-after: DEFAULT_PLACEHOLDER
Expand Down