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/
工作,而不是在瀏覽器中?
我不認爲這是可能的。如果您查看配置文件,則路由器的資源指向routing.yml,但routing.yml不會暴露給config.yml中的任何其他資源。 –
它沒有考慮到進口的parameters.yml?哼。這個頁面讓我認爲這是可能的... http://symfony.com/fr/doc/master/cookbook/routing/service_container_parameters.html – mysthiq
哦。你是對的。我只是試了一下,它似乎只適用於「模式:」,但不適用於「前綴:」 –