You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The proposal is to allow passing a custom base URL for absolute URLs, not just the current/preconfigured context one.
Use case:
My website is working on multiple domains. It is not possible to preconfigure a single one. I need to be able to read the base URL from some config (in yaml or in database) and pass it to the URL builder to make an absolute URL for a specific domain. For example - email generation for different users having sites on different domains where links to their websites must use a specific base URL.
Example
Here is how I solved it in my project with a patch:
What about using the existing setContext(RequestContext $context) / getContext()->setHost('example.com') methods?
I am running a multi-tenant application on subdomains and only had that requirement for email generation in commands.
You could call the methods e.g. from an EventSubscriber listening on KernelEvents or ConsoleEvents or wherever you need it.
Description
The proposal is to allow passing a custom base URL for absolute URLs, not just the current/preconfigured context one.
Use case:
My website is working on multiple domains. It is not possible to preconfigure a single one. I need to be able to read the base URL from some config (in yaml or in database) and pass it to the URL builder to make an absolute URL for a specific domain. For example - email generation for different users having sites on different domains where links to their websites must use a specific base URL.
Example
Here is how I solved it in my project with a patch:
Example usage:
The text was updated successfully, but these errors were encountered: