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

Sunday, January 30, 2022

[FIXED] Symfony custom parameter fails when using composer

 January 30, 2022     composer-php, parameters, symfony     No comments   

Issue

I am having trouble with symfony parameters. In config_dev.yml I have this line:

swiftmailer:
delivery_address: "%support_email%"

and now I want to add the parameter support_email to the parameters.yml

parameters:
   support_email: test@test.com

Now if I run composer update I get this error:

  [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
  You have requested a non-existent parameter "support_email".

What can I do to handle this error?


Solution

Symfony does read the file parameters.yml.dist then build the parameters.yml, and removes parameters that are not defined in the .dist.

Just add this line in parameters.yml.dist:

parameters:
    [...]
    support_email: you@company.com


Answered By - Paul Andrieux
  • 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