Reputation: 857
I have some parameter values in app/config/parameters.yml
parameters:
database_host: 127.0.0.1
database_port: null
database_name: database_name
...
igv: 0.18
isc: 0.18
Now, I want to use the parameters in a Custom class in AppBundle/CustomClass.php. How can I use this parameters? I try $this->container->get('igv') but not works.
Upvotes: 0
Views: 39
Reputation: 4716
In services.yml:
my_app.customclass:
class: AppBundle\CustomClass
arguments: ['%igv%', '%isc%']
Add the arguments to the constructor of AppBundle\CustomClass.
Upvotes: 4