PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, February 5, 2022

[FIXED] How to use newer not stable yet version of symfony?

 February 05, 2022     composer-php     No comments   

Issue

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".


Solution

You (in this example me, because i answer to my own question ) do everything right, just pick wrong branch. Change it to:

{
    ...
    "symfony/form": "5.*-dev",
    ...
}

If you take a closer look on symfony/form repository history you notice that previously composer pick branch which doesn't include commit with feature you request.



Answered By - Sonny D
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing