Skip to content

Commit

Permalink
Add option binaryFormat in constraint file
Browse files Browse the repository at this point in the history
  • Loading branch information
jderusse authored and Jérémy Derussé committed Jun 24, 2014
1 parent e3acdc5 commit deac0c3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion reference/constraints/File.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ form type.
| Applies to | :ref:`property or method <validation-property-target>` |
+----------------+---------------------------------------------------------------------+
| Options | - `maxSize`_ |
| | - `binaryFormat`_ |
| | - `mimeTypes`_ |
| | - `maxSizeMessage`_ |
| | - `mimeTypesMessage`_ |
Expand Down Expand Up @@ -78,7 +79,7 @@ below a certain file size and a valid PDF, add the following:
maxSize: 1024k
mimeTypes: [application/pdf, application/x-pdf]
mimeTypesMessage: Please upload a valid PDF
.. code-block:: php-annotations
Expand Down Expand Up @@ -151,6 +152,18 @@ have been specified.
Options
-------

.. versionadded:: 2.6
The ``binaryFormat`` option was introduced in Symfony 2.6.

binaryFormat
~~~~~~~~~~~~

**type**: ``boolean`` **default**: ``null``

When true, the sizes will be displayed in messages with binary suffixes (KiB, MiB).
When false, the sizes will be displayed with SI suffixes (kB, MB).
When null, then the binaryFormat will be guessed from the suffix defined in the maxSize option.

maxSize
~~~~~~~

Expand Down

0 comments on commit deac0c3

Please sign in to comment.