Neos\FluidAdaptor\Core\Widget\AjaxWidgetComponent::extractWidgetContext PHP Méthode

extractWidgetContext() protected méthode

If the request contains an argument "__widgetId" the context is fetched from the session (AjaxWidgetContextHolder). Otherwise the argument "__widgetContext" is expected to contain the serialized WidgetContext (protected by a HMAC suffix)
protected extractWidgetContext ( Request $httpRequest ) : WidgetContext
$httpRequest Neos\Flow\Http\Request
Résultat WidgetContext
    protected function extractWidgetContext(Request $httpRequest)
    {
        if ($httpRequest->hasArgument('__widgetId')) {
            return $this->ajaxWidgetContextHolder->get($httpRequest->getArgument('__widgetId'));
        } elseif ($httpRequest->hasArgument('__widgetContext')) {
            $serializedWidgetContextWithHmac = $httpRequest->getArgument('__widgetContext');
            $serializedWidgetContext = $this->hashService->validateAndStripHmac($serializedWidgetContextWithHmac);
            return unserialize(base64_decode($serializedWidgetContext));
        }
        return null;
    }