LegacyFusionControllerContext deprecated
final class LegacyFusionControllerContext (View source)
deprecated
| internal |
Legacy stub to replace the original {ControllerContext} inside Fusion {Runtime::getControllerContext()}.
The concept of the controller context inside Fusion has been deprecated.
You should definitely not pass this object along further, which will also most likely not work as it doesn't
satisfy the constraint of instanceof ControllerContext!
To migrate the use case of fetching the active request, please look into {\Neos\Fusion\Core\FusionGlobals::get()} instead.
By convention, an {\Neos\Flow\Mvc\ActionRequest} will be available as request:
$actionRequest = $this->runtime->fusionGlobals->get('request');
if (!$actionRequest instanceof ActionRequest) {
// fallback or error
}
To get an {\Neos\Flow\Mvc\Routing\UriBuilder} proceed with:
$uriBuilder = new UriBuilder();
$uriBuilder->setRequest($actionRequest);
WARNING regarding {\Neos\Fusion\Core\Runtime::getControllerContext()}:
Invoking this backwards-compatible layer is possibly unsafe, if the rendering was not started
in {\Neos\Fusion\Core\self::renderResponse()} or no request global is available. This will raise an exception.
Properties
| protected FlashMessageService | $flashMessageService |
Methods
No description
To migrate the use case of fetching the active request, please look into {FusionGlobals::get()} instead.
To migrate the use case of getting the UriBuilder please use this instead:
To migrate this use case please use {FlashMessageService::getFlashMessageContainerForRequest()} in combination with fetching the active request as described here {getRequest} instead.
Details
__construct(ActionRequest $request, ActionResponse $legacyActionResponseForCurrentRendering)
No description
ActionRequest
getRequest()
deprecated
deprecated
To migrate the use case of fetching the active request, please look into {FusionGlobals::get()} instead.
By convention, an {\Neos\Flow\Mvc\ActionRequest} will be available as request:
$actionRequest = $this->runtime->fusionGlobals->get('request'); if (!$actionRequest instanceof ActionRequest) { // fallback or error }
UriBuilder
getUriBuilder()
deprecated
deprecated
To migrate the use case of getting the UriBuilder please use this instead:
$actionRequest = $this->runtime->fusionGlobals->get('request'); if (!$actionRequest instanceof ActionRequest) { // fallback or error } $uriBuilder = new UriBuilder(); $uriBuilder->setRequest($actionRequest);
FlashMessageContainer
getFlashMessageContainer()
deprecated
deprecated
To migrate this use case please use {FlashMessageService::getFlashMessageContainerForRequest()} in combination with fetching the active request as described here {getRequest} instead.
ActionResponse
getResponse()
deprecated
deprecated
| internal | THIS SHOULD NEVER BE CALLED ON USER-LAND |
PURELY INTERNAL with partially undefined behaviour!!!
Gives access to the legacy mutable action response simulation {[\Neos\Fusion\Core\Runtime::withSimulatedLegacyControllerContext()}
Initially](../../../Neos/Fusion/Core/Runtime.html) it was possible to mutate the current response of the active MVC controller through this getter.
While HIGHLY internal behaviour and ONLY to be used by Neos.Fusion.Form or Neos.Neos:Plugin this legacy layer is in place to still allow this functionality.