Neos\Flow\Http\Component\ComponentContext::replaceHttpResponse PHP Метод

replaceHttpResponse() публичный Метод

public replaceHttpResponse ( Response $httpResponse ) : void
$httpResponse Neos\Flow\Http\Response
Результат void
    public function replaceHttpResponse(Response $httpResponse)
    {
        $this->httpResponse = $httpResponse;
    }

Usage Example

Пример #1
0
 /**
  * Check if the current request match a redirect
  *
  * @param ComponentContext $componentContext
  * @return void
  */
 public function handle(ComponentContext $componentContext)
 {
     $routingMatchResults = $componentContext->getParameter(RoutingComponent::class, 'matchResults');
     if ($routingMatchResults !== NULL) {
         return;
     }
     $httpRequest = $componentContext->getHttpRequest();
     $response = $this->redirectService->buildResponseIfApplicable($httpRequest);
     if ($response !== null) {
         $componentContext->replaceHttpResponse($response);
         $componentContext->setParameter(ComponentChain::class, 'cancel', true);
     }
 }