Reputation: 33
How can i change the /api in my routing to make it configurable for my customer without editing the routing.yml ?
api_entry:
path: /api/{method}
defaults: { _controller: WarrenApiBundle:Api:method }
Upvotes: 3
Views: 435
Reputation: 52483
You can introduce a config parameter to configure for this purpose ...
# app/config/config.yml
parameters:
api_prefix: your_api
... then use it inside your routing.yml
# app/config/routing.yml
api_entry:
path: /%api_prefix%/{method}
defaults: { _controller: WarrenApiBundle:Api:method }
Upvotes: 3