Closed bakura10 closed 9 years ago
Route prepending is not required in in Dash anymore. You can simple add e.g. the hostname or secure property to the existing route via overriding.
Nope this is not a solution. In my app for instance I have different host names based on my environment, so I write it once and then prepend it to my routes, so I don't have to duplicatebtheblogic of detecting environment and choosing environment. Makes sense ?
You can do the exact same with config overrides, e.g. in local.config.php.
But I don't have any routes in those files. The config is scattered across module config files.
The reason why I didn't re-implement route-prepending is because it was basically a total mess. Also there's no such thing as a hostname route. If you don't have a single parent route which you can easily override, you could always use application-level constants or environment variables.
Hi,
I don't remember if this is coded in Dash, but in ZF2, I always struggle very very hard with prepending a route to an existing route. You ahve to create "prototype", and used "chain_routes", which is very confusign. For Dash, I suggest a mapping like that:
And boom.