无法在线解析(靠近“ - [setRouter,['@ router']]”)

时间:2017-01-09 14:08:45

标签: symfony service

我有以下services.yml配置。我的语法出了什么问题?

parameters:
    #    parameter_name: value

    services:
      redirect.after.login:
          class: UserBundle\Redirection\AfterLoginFailureRedirection
          arguments: ["@http_kernel","@security.http_utils"]
          calls:
              -[setRouter,['@router']]
              -[setContainer,['@container']]
    #    service_name:
    #        class: AppBundle\Directory\ClassName
    #        arguments: ["@another_service_name", "plain_value", "%parameter_name%"]

1 个答案:

答案 0 :(得分:0)

您错过了-[

之间的空格
parameters:
  services:
    redirect.after.login:
      class: UserBundle\Redirection\AfterLoginFailureRedirection
        arguments: ["@http_kernel","@security.http_utils"]
        calls:
          - [setRouter, ['@router']]
          - [setContainer, ['@container']]