Currently I use 5.2.3
version of Symfony. I want to use feature from this pull request https://github.com/symfony/symfony/pull/36851. It's rather github / composer related question rather than symfony itself. How to do it?
So far I try:
{
...
"symfony/form": "5.2.*-dev", // changes I made to composer.json
...
}
The composer update end successfully:
- Upgrading symfony/form (v5.2.4 => 5.2.x-dev 7664ad9): Extracting archive
But still If I use choice_translation_parameters
in code I get:
public function buildForm(FormBuilderInterface $builder, array $options)
{
...
$builder->add('amount', ChoiceType::class, ["label" => "rese.amount?", "choices" => $roomAmountChoices, "choice_translation_parameters" => []]);
...
}
An error has occurred resolving the options of the form "Symfony\Component\Form\Extension\Core\Type\ChoiceType": The option "choice_translation_parameters" does not exist. Defined options are: "action", "allow_file_upload", "attr", "attr_translation_parameters", "auto_initialize", "block_name", "block_prefix", "by_reference", "choice_attr", "choice_filter", "choice_label", "choice_loader", "choice_name", "choice_translation_domain", "choice_value", "choices", "compound", "csrf_field_name", "csrf_message", "csrf_protection", "csrf_token_id", "csrf_token_manager", "data", "data_class", "disabled", "ea_crud_form", "empty_data", "error_bubbling", "expanded", "getter", "group_by", "help", "help_attr", "help_html", "help_translation_parameters", "inherit_data", "invalid_message", "invalid_message_parameters", "is_empty_callback", "label", "label_attr", "label_format", "label_html", "label_translation_parameters", "mapped", "method", "multiple", "placeholder", "post_max_size_message", "preferred_choices", "property_path", "required", "row_attr", "setter", "translation_domain", "trim", "upload_max_size_message".
Read more here: https://stackoverflow.com/questions/66483166/how-to-use-newer-not-stable-yet-version-of-symfony
Content Attribution
This content was originally published by Sonny D at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.