user2484142
user2484142

Reputation: 33

How can i make my url configurable?

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

Answers (1)

Nicolai Fröhlich
Nicolai Fröhlich

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

Related Questions