class LocaleSwitchRedirector implements HTTPMiddleware (View source)

This middleware will safely redirect you to the cms landing page when switching locales, in case you were viewing a url that does not apply to the new locale.

Methods

public
process(HTTPRequest $request, callable $delegate)

Generate response for the given request

protected
mixed
getParamLocale(HTTPRequest $request)

Get locale from the query_param

Details

HTTPResponse process(HTTPRequest $request, callable $delegate)

Generate response for the given request

Parameters

HTTPRequest $request
callable $delegate

Return Value

HTTPResponse

protected mixed getParamLocale(HTTPRequest $request)

Get locale from the query_param

Parameters

HTTPRequest $request

Return Value

mixed