From deac0c3a6fd13c61eeca59d715c7fab014836f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 1 Jun 2014 15:33:56 +0200 Subject: [PATCH] Add option binaryFormat in constraint file --- reference/constraints/File.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/reference/constraints/File.rst b/reference/constraints/File.rst index 7d200e4f36b..a09c98a70d8 100644 --- a/reference/constraints/File.rst +++ b/reference/constraints/File.rst @@ -20,6 +20,7 @@ form type. | Applies to | :ref:`property or method ` | +----------------+---------------------------------------------------------------------+ | Options | - `maxSize`_ | +| | - `binaryFormat`_ | | | - `mimeTypes`_ | | | - `maxSizeMessage`_ | | | - `mimeTypesMessage`_ | @@ -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 @@ -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 ~~~~~~~