将config.yml设置注入服务

时间:2015-03-31 17:23:43

标签: symfony

我的config.yml中有一些设置,我希望将其作为参数传递给services.yml中的服务。

#config.yml
hwi_oauth:
resource_owners:
        facebook:
            type:                facebook
            client_id:           %facebook_app_id%
            client_secret:       %facebook_app_secret%
            scope:               "email, public_profile, user_friends"
            infos_url:     "https://graph.facebook.com/me?fields=id,name,email,picture.type(square)"
            paths:
                email:          email
                profilepicture: picture.data.url
            options:
                display: popup #dialog is optimized for popup window


#services.yml
hwi_oauth.resource_owner.facebook:
      class: AppBundle\OAuth\ResourceOwner\FacebookResourceOwner
      arguments: ['@hwi_oauth.http_client','@security.http_utils',**{INJECT HERE}**,'@hwi_oauth.storage.session']

我该怎么做?

1 个答案:

答案 0 :(得分:1)

将这些值作为参数。您可以将参数注入服务中。