diff --git a/reference/forms/types/options/help.rst.inc b/reference/forms/types/options/help.rst.inc index ded87842d8e..86f84111c88 100644 --- a/reference/forms/types/options/help.rst.inc +++ b/reference/forms/types/options/help.rst.inc @@ -1,11 +1,25 @@ help ~~~~ -**type**: ``string`` **default**: null +**type**: ``string`` or ``TranslatableMessage`` **default**: null Allows you to define a help message for the form field, which by default is rendered below the field:: - $builder->add('zipCode', null, [ - 'help' => 'The ZIP/Postal code for your credit card\'s billing address.', - ]); + use Symfony\Component\Translation\TranslatableMessage; + + $builder + ->add('zipCode', null, [ + 'help' => 'The ZIP/Postal code for your credit card\'s billing address.', + ]) + + // ... + + ->add('status', null, [ + 'help' => new TranslatableMessage('order.status', ['%order_id%' => $order->getId()], 'store'), + ]) + ; + +.. versionadded:: 5.4 + + Support for passing ``TranslatableMessage`` objects was introduced in Symfony 5.4.