Commit 8f8ba416 authored by Igor Wiedler's avatar Igor Wiedler

[1.1] Update all symfony version references in the docs to 2.3

parent 7a14b209
...@@ -11,7 +11,7 @@ your ``composer.json`` file: ...@@ -11,7 +11,7 @@ your ``composer.json`` file:
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/yaml": "~2.1" "symfony/yaml": "~2.3"
} }
Next, you need to tell the Validation Service that you are not using Next, you need to tell the Validation Service that you are not using
......
...@@ -55,7 +55,7 @@ Registering ...@@ -55,7 +55,7 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/form": "~2.1.4" "symfony/form": "~2.3"
} }
If you are going to use the validation extension with forms, you must also If you are going to use the validation extension with forms, you must also
...@@ -65,9 +65,9 @@ Registering ...@@ -65,9 +65,9 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/validator": "~2.1", "symfony/validator": "~2.3",
"symfony/config": "~2.1", "symfony/config": "~2.3",
"symfony/translation": "~2.1" "symfony/translation": "~2.3"
} }
The Symfony Form Component relies on the PHP intl extension. If you don't have The Symfony Form Component relies on the PHP intl extension. If you don't have
...@@ -76,7 +76,7 @@ Registering ...@@ -76,7 +76,7 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/locale": "~2.1" "symfony/locale": "~2.3"
} }
If you want to use forms in your Twig templates, make sure to install the If you want to use forms in your Twig templates, make sure to install the
...@@ -85,7 +85,7 @@ Registering ...@@ -85,7 +85,7 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/twig-bridge": "~2.1" "symfony/twig-bridge": "~2.3"
} }
Usage Usage
...@@ -199,4 +199,4 @@ Traits ...@@ -199,4 +199,4 @@ Traits
$app->form($data); $app->form($data);
For more information, consult the `Symfony2 Forms documentation For more information, consult the `Symfony2 Forms documentation
<http://symfony.com/doc/2.1/book/forms.html>`_. <http://symfony.com/doc/2.3/book/forms.html>`_.
...@@ -60,7 +60,7 @@ Registering ...@@ -60,7 +60,7 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/security": "~2.1" "symfony/security": "~2.3"
} }
.. caution:: .. caution::
...@@ -76,7 +76,7 @@ Usage ...@@ -76,7 +76,7 @@ Usage
The Symfony Security component is powerful. To learn more about it, read the The Symfony Security component is powerful. To learn more about it, read the
`Symfony2 Security documentation `Symfony2 Security documentation
<http://symfony.com/doc/2.1/book/security.html>`_. <http://symfony.com/doc/2.3/book/security.html>`_.
.. tip:: .. tip::
......
...@@ -50,7 +50,7 @@ Registering ...@@ -50,7 +50,7 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/translation": "~2.1" "symfony/translation": "~2.3"
} }
Usage Usage
...@@ -126,8 +126,8 @@ file: ...@@ -126,8 +126,8 @@ file:
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/config": "~2.1", "symfony/config": "~2.3",
"symfony/yaml": "~2.1" "symfony/yaml": "~2.3"
} }
Next, you have to create the language mappings in YAML files. A naming you can Next, you have to create the language mappings in YAML files. A naming you can
......
...@@ -60,7 +60,7 @@ some Symfony2 components and Twig. Add it as a dependency to your ...@@ -60,7 +60,7 @@ some Symfony2 components and Twig. Add it as a dependency to your
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/twig-bridge": "~2.1" "symfony/twig-bridge": "~2.3"
} }
When present, the ``TwigServiceProvider`` will provide you with the following When present, the ``TwigServiceProvider`` will provide you with the following
......
...@@ -44,7 +44,7 @@ Registering ...@@ -44,7 +44,7 @@ Registering
.. code-block:: json .. code-block:: json
"require": { "require": {
"symfony/validator": "~2.1" "symfony/validator": "~2.3"
} }
Usage Usage
...@@ -131,12 +131,12 @@ the class properties and getters, and then call the ``validate`` method:: ...@@ -131,12 +131,12 @@ the class properties and getters, and then call the ``validate`` method::
$book->title = 'My Book'; $book->title = 'My Book';
$book->author = $author; $book->author = $author;
$metadata = $app['validator.mapping.class_metadata_factory']->getClassMetadata('Author'); $metadata = $app['validator.mapping.class_metadata_factory']->getMetadataFor('Author');
$metadata->addPropertyConstraint('first_name', new Assert\NotBlank()); $metadata->addPropertyConstraint('first_name', new Assert\NotBlank());
$metadata->addPropertyConstraint('first_name', new Assert\Length(array('min' => 10))); $metadata->addPropertyConstraint('first_name', new Assert\Length(array('min' => 10)));
$metadata->addPropertyConstraint('last_name', new Assert\Length(array('min' => 10))); $metadata->addPropertyConstraint('last_name', new Assert\Length(array('min' => 10)));
$metadata = $app['validator.mapping.class_metadata_factory']->getClassMetadata('Book'); $metadata = $app['validator.mapping.class_metadata_factory']->getMetadataFor('Book');
$metadata->addPropertyConstraint('title', new Assert\Length(array('min' => 10))); $metadata->addPropertyConstraint('title', new Assert\Length(array('min' => 10)));
$metadata->addPropertyConstraint('author', new Assert\Valid()); $metadata->addPropertyConstraint('author', new Assert\Valid());
...@@ -150,11 +150,6 @@ the class properties and getters, and then call the ``validate`` method:: ...@@ -150,11 +150,6 @@ the class properties and getters, and then call the ``validate`` method::
echo 'The author is valid'; echo 'The author is valid';
} }
.. note::
If you are using Symfony 2.2, replace the ``getClassMetadata`` calls with
calls to the new ``getMetadataFor`` method.
You can also declare the class constraint by adding a static You can also declare the class constraint by adding a static
``loadValidatorMetadata`` method to your classes:: ``loadValidatorMetadata`` method to your classes::
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment