symfony 1.4 - 在factories.yml中设置一个路由值时删除所有路由值

时间:2014-11-24 12:49:17

标签: symfony-1.4

用于开发/生产目的我在factories.yml

中设置它
all:
  routing:
    class: sfPatternRouting
    param:
      generate_shortest_url:            true
      logging:    false
      extra_parameters_as_query_string: true
      context:
        host: www.mydomain.com

不幸的是,这导致通常在路由上下文中的所有内容都被覆盖,因此缺少诸如prefix,referrer等之类的东西:

没有在factories.yml中设置此上下文。  当你查看路由时,你会得到一整套上下文变量

object(sfRoute)[31]
protected 'isBound' => boolean true
protected 'context' => 
array
  'path_info' => string '/login' (length=6)
  'prefix' => string '/clients' (length=8)
  'method' => string 'GET' (length=3)
  'format' => null
  'host' => string 'www.domain.com' 
  'is_secure' => boolean false
  'request_uri' => string 'http:/www.domain.com/clients/login' 
 protected 'parameters' => 
array
  'module' => string 'sfGuardAuth' (length=11)
........

但是这个以及除了主机之外的所有上下文变量(这是我在factories.yml中明确设置的)都没有设置。

object(sfRoute)[47]
 protected 'isBound' => boolean true
  protected 'context' => 
array
      'host' => string 'www.newdomain.com' 
protected 'parameters' => 
array
  'module' => string 'sfGuardAuth' (length=11)

.....

有没有人知道如何设置这个'主机'上下文变量而不擦除其他所有内容?

0 个答案:

没有答案