Closed codeguy closed 7 years ago
yikes.... this one is going to cause a lot of pain...
I suppose in the end this is a content rendering problem, which can be handled at a twig level.
We should at least document a good way on how to extract the base-path in the framework, or provide a function call to do that.
Hello @geggleto, the basePath/baseUrl can be set with an early middleware. This also makes the entire application more portable and "mountable" inside existing site/applications path. There are 2 ways to implement a basePath middleware:
I used to prefer option 1. Lately I use option 2 more often...less overhead. Moving an application is a developer's task, so path/url can be re-set "manually" at the same time. Option 1 is still required on some edge cases lile for instance when the same site is hosted on different domains/vhosts with different base paths / urls.
kind regards maks
PR submitted https://github.com/slimphp/Slim/pull/2087
I'm still on the fence... While I know most of us will accept this change it will be hard for newer developers to learn Slim in an easy envrionment, ie Windows XAMPP.
We will have to make sure documentation is updated to accommodate this change.
Just remove it entirely. Let web server configuration handle edge case base path scenarios.