2012-04-05 11 views
0

在routing.yml中我的ressource其他路由CONFIGS有:的Symfony2:如何以XML的ressource路由文件

AcmeTestBundle: 
resource: "@AcmeTestBundle/Resources/config/routing.xml" 
prefix: /

如何進行配置看在XML一樣嗎?

我想:

<route id="AcmeTestBundle"> 
    <default key="_ressource">AcmeTestBundle/Resources/config/routing.xml</default> 
</route> 

但是,這並不工作...

回答

1

看一看官方手冊

http://symfony.com/doc/current/book/routing.html#including-external-routing-resources

在那裏,你可以點擊標籤命名爲「XML」

<!-- app/config/routing.xml --> 
<?xml version="1.0" encoding="UTF-8" ?> 

<routes xmlns="http://symfony.com/schema/routing" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> 

    <import resource="@AcmeHelloBundle/Resources/config/routing.xml" /> 
</routes> 
+1

感謝你,沒有發現它的第一個: 2012-04-05 09:50:08