wrapControllerExecutionInRenderContext example


  public function onController(ControllerEvent $event) {
    $controller = $event->getController();

    // See \Symfony\Component\HttpKernel\HttpKernel::handleRaw().     $arguments = $this->argumentResolver->getArguments($event->getRequest()$controller);

    $event->setController(function D) use ($controller$arguments) {
      return $this->wrapControllerExecutionInRenderContext($controller$arguments);
    });
  }

  /** * Wraps a controller execution in a render context. * * @param callable $controller * The controller to execute. * @param array $arguments * The arguments to pass to the controller. * * @return mixed * The return value of the controller. * * @throws \LogicException * When early rendering has occurred in a controller that returned a * Response or domain object that cares about attachments or cacheability. * * @see \Symfony\Component\HttpKernel\HttpKernel::handleRaw() */
Home | Imprint | This part of the site doesn't use cookies.