2013-01-02 75 views
0

我有這樣的錯誤Symfony的2.1.4 - 與parameters.yml動態路由

沒有路由發現 「GET/SN /」

,這..在parameters.yml

parameters: 
[...] 
    client_abv:   sn 

而且我的routing.yml文件:

_internal: 
    resource: "@FrameworkBundle/Resources/config/routing/internal.xml" 
    prefix: /_internal 

ClientResultBundle_Admin: 
    resource: "@ClientResultBundle/Resources/config/routing/admin.yml" 
    prefix: /%client_abv%/admin 

ClientResultBundle_PointDeVente: 
    resource: "@ClientResultBundle/Resources/config/routing/pointdevente.yml" 
    prefix: /%client_abv%/pointdevente 

ClientResultBundle_Sn: 
    resource: "@ClientResultBundle/Resources/config/routing/sn.yml" 
    prefix: /%client_abv% 

ClientResultBundle: 
    resource: "@ClientResultBundle/Resources/config/routing.yml" 
    prefix: /%client_abv% 

那麼爲什麼命令控制檯route:match /sn/工作,而不是在瀏覽器中?

+0

我不認爲這是可能的。如果您查看配置文件,則路由器的資源指向routing.yml,但routing.yml不會暴露給config.yml中的任何其他資源。 –

+0

它沒有考慮到進口的parameters.yml?哼。這個頁面讓我認爲這是可能的... http://symfony.com/fr/doc/master/cookbook/routing/service_container_parameters.html – mysthiq

+0

哦。你是對的。我只是試了一下,它似乎只適用於「模式:」,但不適用於「前綴:」 –

回答

0

擺脫結尾斜槓 - 指向/sn

+0

這是一樣的。指向/ sn給我沒有找到「GET/sn」的路由 – mysthiq