BaseUrlResolver
final class BaseUrlResolver (View source)
Resolves absolute application URLs only from explicit configuration or validated request metadata.
An explicit app base URL always wins and is never combined with a forwarded request prefix.
Methods
Binds URL resolution to application configuration and an optional active request context.
__invoke(string $path = '')
Resolves the canonical base URL and appends an optional relative path.
string
baseUrl(string $path = '')
Uses explicit configuration first and otherwise requires an allowlisted request host.
string
Details
__construct
__construct(AppConfig $config, ResolvedRequestContext|null $requestContext = null)
Binds URL resolution to application configuration and an optional active request context.
__invoke
string
__invoke(string $path = '')
Resolves the canonical base URL and appends an optional relative path.
baseUrl
string
baseUrl(string $path = '')
Uses explicit configuration first and otherwise requires an allowlisted request host.