Skip to content

Commit 6eada5b

Browse files
committed
minor #12039 Mentioned the automatic set of "accept" based on "mimeTypes" (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch (closes #12039). Discussion ---------- Mentioned the automatic set of "accept" based on "mimeTypes" Fixes #12024. Commits ------- 17e1a5a Mentioned the automatic set of \"accept\" based on \"mimeTypes\"
2 parents 1dbda6f + 17e1a5a commit 6eada5b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

reference/constraints/File.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,20 @@ of given mime types (if an array).
242242

243243
You can find a list of existing mime types on the `IANA website`_.
244244

245+
.. note::
246+
247+
When using this constraint on a :doc:`FileType field </reference/forms/types/file>`,
248+
the value of the ``mimeTypes`` option is also used in the ``accept``
249+
attribute of the related ``<input type="widget"/>`` HTML element.
250+
251+
This behavior is applied only when using :ref:`form type guessing <form-type-guessing>`
252+
(i.e. the form type is not defined explicitly in the ``->add()`` method of
253+
the form builder) and when the field doesn't define its own ``accept`` value.
254+
255+
.. versionadded:: 4.4
256+
257+
This feature was introduced in Symfony 4.4.
258+
245259
mimeTypesMessage
246260
~~~~~~~~~~~~~~~~
247261

0 commit comments

Comments
 (0)