Symfony奇怪的factory.yml

时间:2011-05-28 09:08:40

标签: symfony1 symfony-1.4 symfony-forms

我需要通过symfony发送电子邮件,但在我的factories.yml中它有这样的东西

all:
  routing:
    class: sfPatternRouting
    param:
      generate_shortest_url:            true
      extra_parameters_as_query_string: true
  view_cache_manager:
    class: sfViewCacheManager
    param:
      cache_key_use_vary_headers: true
      cache_key_use_host_name:    true  

我将它们修改为:

all:
   mailer:
    param:
      transport:
        class: Swift_SmtpTransport
        param:
          host:       smtp.gmail.com
          port:       465
          encryption: ssl
          username: myemail@gmail.com
          password: password
它会影响什么吗?或者最顶层的原作是什么?

1 个答案:

答案 0 :(得分:3)

为什么删除以前的值?只需合并两个文件,如下所示:

all:
  routing:
    class: sfPatternRouting
    param:
      generate_shortest_url:            true
      extra_parameters_as_query_string: true
  view_cache_manager:
    class: sfViewCacheManager
    param:
      cache_key_use_vary_headers: true
      cache_key_use_host_name:    true  
  mailer:
    param:
      transport:
        class: Swift_SmtpTransport
        param:
          host:       smtp.gmail.com
          port:       465
          encryption: ssl
          username: myemail@gmail.com
          password: password

否则,路由和view_cache_manager的设置将是您在factories.yml

中某处的lib/vendor/symfony上找到的设置