Skip to content

[Form] Remove paragraph on legacy_error_messages config #17478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -559,48 +559,6 @@ To see the second approach - adding constraints to the form - and to
learn more about the validation constraints, please refer to the
:doc:`Symfony validation documentation </validation>`.

Form Validation Messages
~~~~~~~~~~~~~~~~~~~~~~~~

The form types have default error messages that are more clear and
user-friendly than the ones provided by the validation constraints. To enable
these new messages set the ``legacy_error_messages`` option to ``false``:

.. configuration-block::

.. code-block:: yaml

# config/packages/framework.yaml
framework:
form:
legacy_error_messages: false

.. code-block:: xml

<!-- config/packages/framework.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<framework:config>
<framework:form legacy-error-messages="false"/>
</framework:config>
</container>

.. code-block:: php

// config/packages/framework.php
use Symfony\Config\FrameworkConfig;

return static function (FrameworkConfig $framework) {
$framework->form()->legacyErrorMessages(false);
};

Other Common Form Features
--------------------------

Expand Down