如何在不编辑 routing.yml 的情况下更改我的路由中的/api 以使其可供我的客户配置?
api_entry:
path: /api/{method}
defaults: { _controller: WarrenApiBundle:Api:method }
最佳答案
你可以引入一个配置参数来配置这个目的......
# app/config/config.yml
parameters:
api_prefix: your_api
... 然后在你的 routing.yml 中使用它
# app/config/routing.yml
api_entry:
path: /%api_prefix%/{method}
defaults: { _controller: WarrenApiBundle:Api:method }
关于symfony - 我怎样才能使我的网址可配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17098779/