在Symfony 2.5中导入路由时定义路由而不结束斜线?

时间:2014-06-18 17:52:53

标签: symfony url-routing yaml routes

在文件中:HardCoreMore / HRAPIBundle / Resources / config / routing.yml

我已经导入了这样的路线:

hr_api_company:
resource: "@HRAPIBundle/Resources/config/routing/company.yml"
prefix: /company

在文件中:HardCoreMore / HRAPIBundle / Resources / config / routing / company.yml

我已经定义了创建公司的路线:

hardcoremore_hr_api_company_create:
pattern: /
defaults: { _controller: HRAPIBundle:Company:create }
methods:  [POST]

现在该路线与以下网址匹配:

POST公司/

但是当我用它调用时它不匹配:

POST公司

如何在导入路径并为其添加前缀时定义路由而不结束斜杠?

1 个答案:

答案 0 :(得分:1)

这是不可能的,请参阅:https://github.com/symfony/symfony/issues/4322

我希望这有帮助