For example, in my services.yml file next code:
parameters:
social:
facebook:
app_id: 123456789
secret: dkl41a5dw1daw11d1wa135451awwlflaw
google:
id: 12548411654
services:
bw.user.social:
class: BW\UserBundle\Service\SocialService
arguments: [%social.facebook%]
This method does not work. I can use this:
services:
bw.user.social:
class: BW\UserBundle\Service\SocialService
arguments: [%social%]
But it's not exactly what I need. How can I pass only facebook value without google and , it's very important, not change parameters structure?
You have to write your parameters like this :
parameters:
social.facebook:
app_id: 123456789
secret: dkl41a5dw1daw11d1wa135451awwlflaw
social.google:
id: 12548411654
Then you can use :
services:
bw.user.social:
class: BW\UserBundle\Service\SocialService
arguments: [%social.facebook%]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With