diff --git a/reference/constraints/All.rst b/reference/constraints/All.rst
index b7941006504..7859e574d26 100644
--- a/reference/constraints/All.rst
+++ b/reference/constraints/All.rst
@@ -51,6 +51,22 @@ entry in that array:
protected $favoriteColors = array();
}
+ .. code-block:: xml
+
+
+
+
+
+
+
+
+
+
Now, each entry in the ``favoriteColors`` array will be validated to not
be blank and to be at least 5 characters long.
diff --git a/reference/constraints/Choice.rst b/reference/constraints/Choice.rst
index 907b301dcd0..e62f9924d9d 100644
--- a/reference/constraints/Choice.rst
+++ b/reference/constraints/Choice.rst
@@ -49,7 +49,7 @@ If your valid choice list is simple, you can pass them in directly via the
.. code-block:: xml
-
+
@@ -280,4 +280,4 @@ strict
If true, the validator will also check the type of the input value. Specifically,
this value is passed to as the third argument to the PHP :phpfunction:`in_array` method
-when checking to see if a value is in the valid choices array.
\ No newline at end of file
+when checking to see if a value is in the valid choices array.
diff --git a/reference/constraints/Count.rst b/reference/constraints/Count.rst
index 169fe523bc0..b954fea7af6 100644
--- a/reference/constraints/Count.rst
+++ b/reference/constraints/Count.rst
@@ -38,8 +38,8 @@ you might add the following:
- Count:
min: 1
max: 5
- minMessage: You must specify at least one email
- maxMessage: You cannot specify more than 5 emails
+ minMessage: "You must specify at least one email"
+ maxMessage: "You cannot specify more than {{ limit }} emails"
.. code-block:: php-annotations
@@ -53,12 +53,27 @@ you might add the following:
* min = "1",
* max = "5",
* minMessage = "You must specify at least one email",
- * maxMessage = "You cannot specify more than 5 emails"
+ * maxMessage = "You cannot specify more than {{ limit }} emails"
* )
*/
protected $emails = array();
}
+ .. code-block:: xml
+
+
+
+
+
+
+
+
+
+
Options
-------
diff --git a/reference/constraints/Regex.rst b/reference/constraints/Regex.rst
index 1248a958969..30bc07fd5fc 100644
--- a/reference/constraints/Regex.rst
+++ b/reference/constraints/Regex.rst
@@ -48,6 +48,17 @@ characters at the beginning of your string:
protected $description;
}
+ .. code-block:: xml
+
+
+
+
+
+
/^\w+/
+
+
+
+
Alternatively, you can set the `match`_ option to ``false`` in order to assert
that a given string does *not* match. In the following example, you'll assert
that the ``firstName`` field does not contain any numbers and give it a custom
@@ -85,6 +96,19 @@ message:
protected $firstName;
}
+ .. code-block:: xml
+
+
+
+
+
+
/\d/
+
false
+
Your name cannot contain a number
+
+
+
+
Options
-------
@@ -114,4 +138,4 @@ message
**type**: ``string`` **default**: ``This value is not valid``
-This is the message that will be shown if this validator fails.
\ No newline at end of file
+This is the message that will be shown if this validator fails.
diff --git a/reference/constraints/Time.rst b/reference/constraints/Time.rst
index 0297db4ca64..0db10595185 100644
--- a/reference/constraints/Time.rst
+++ b/reference/constraints/Time.rst
@@ -46,6 +46,15 @@ of the day when the event starts:
protected $startsAt;
}
+ .. code-block:: xml
+
+
+
+
+
+
+
+
Options
-------
diff --git a/reference/constraints/Type.rst b/reference/constraints/Type.rst
index 50dd1d88dc2..4dc9005253c 100644
--- a/reference/constraints/Type.rst
+++ b/reference/constraints/Type.rst
@@ -46,6 +46,18 @@ Basic Usage
protected $age;
}
+ .. code-block:: xml
+
+
+
+
+
+
integer
+
The value {{ value }} is not a valid {{ type }}.
+
+
+
+
Options
-------
@@ -80,4 +92,4 @@ message
**type**: ``string`` **default**: ``This value should be of type {{ type }}``
-The message if the underlying data is not of the given type.
\ No newline at end of file
+The message if the underlying data is not of the given type.
diff --git a/reference/constraints/Url.rst b/reference/constraints/Url.rst
index 6e50aae5e3c..8f1fce898c2 100644
--- a/reference/constraints/Url.rst
+++ b/reference/constraints/Url.rst
@@ -42,6 +42,15 @@ Basic Usage
protected $bioUrl;
}
+ .. code-block:: xml
+
+
+
+
+
+
+
+
Options
-------