From 28cae48dde8d6972ed7e0a53686598a8c4a01fea Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 22 Jul 2022 16:37:21 +0200 Subject: [PATCH] [Form] Mention that choice labels support TranslatableInterface objects --- reference/forms/types/options/choice_label.rst.inc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reference/forms/types/options/choice_label.rst.inc b/reference/forms/types/options/choice_label.rst.inc index aa83524ad88..33b5ccbfc54 100644 --- a/reference/forms/types/options/choice_label.rst.inc +++ b/reference/forms/types/options/choice_label.rst.inc @@ -29,6 +29,12 @@ more control:: }, ]); +.. versionadded:: 6.2 + + Starting from Symfony 6.2, you can use any object that implements + :class:`Symfony\\Contracts\\Translation\\TranslatableInterface` as the value + of the choice label. + This method is called for *each* choice, passing you the ``$choice`` and ``$key`` from the choices array (additional ``$value`` is related to `choice_value`_). This will give you: