2
路由文件中的routing.yml我的ressource其他路由CONFIGS有:的ressource在XML
leaphly_cart:
type: rest
resource: '@AppXXXBundle/Resources/config/rest.xml'
prefix: /api/v1/
而且rest.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 id="carts" type="rest" resource="leaphly_cart.cart.limited.controller" name-prefix="api_1_" />
<import id="cartItems" type="rest" resource="leaphly_cart.cart_item.limited.controller" name-prefix="api_1_" parent="carts" />
<import id="carts_full" type="rest" resource="leaphly_cart.cart.full.controller" name-prefix="api_1_full_" prefix="/full" />
<import id="cartItems_full" type="rest" resource="leaphly_cart.cart_item.full.controller" name-prefix="api_1_full_" parent="carts_full" prefix="/full" />
<import id="cartTransitions" type="rest" resource="Leaphly\CartBundle\Controller\CartTransitionsController" name-prefix="api_1_" parent="carts" />
</routes>
但是,这并不工作...并显示错误:
InvalidArgumentException: [ERROR 1845] Element '{http://symfony.com/schema/routing}routes': No matching global declaration available for the validation root. (in /var/www/app.com/web/ - line 5, column 0)
这是怎么回事?
你错过了''还是仅仅是复制/粘贴错误? –
我想念最后提到。我已经更新了相同的代码。 – Sid
请修正问题中的缩进以反映实际代码中的缩进。您的'routing.yml'中的行不会以当前的形式工作。 – nifr