Answer the question
In order to leave comments, you need to log in
How to specify a parameter from app/config/config.yml in the service parameters?
Good afternoon.
There is a service for which you need to specify parameters. And there is a great desire that this parameter can be edited in app/config/config.yml
This works well:
//src/Bundle/Resources/config/services.yml
parameters:
visicom_key: fffeeeccccddddd
visicom_limit: 10
services:
search_street:
class: SearchStreetClass
arguments: [%visicom_key%, %visicom_limit%]
Answer the question
In order to leave comments, you need to log in
Your bundle has a directory called DependencyInjection. All the magic happens there. It is there that the rules for parsing the rules for the bundle are set, and it is there that the parameters from config.yml can be put into the container and used in your services.
symfony.com/doc/current/cookbook/configuration/usi...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question