You are here

public function LazyLoadingFragmentHandler::render in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php \Symfony\Component\HttpKernel\DependencyInjection\LazyLoadingFragmentHandler::render()

Renders a URI and returns the Response content.

Available options:

  • ignore_errors: true to return an empty string in case of an error

Parameters

string|ControllerReference $uri A URI as a string or a ControllerReference instance:

string $renderer The renderer name:

array $options An array of options:

Return value

string|null The Response content or null when the Response is streamed

Throws

\InvalidArgumentException when the renderer does not exist

\LogicException when no master request is being handled

Overrides FragmentHandler::render

File

vendor/symfony/http-kernel/DependencyInjection/LazyLoadingFragmentHandler.php, line 48

Class

LazyLoadingFragmentHandler
Lazily loads fragment renderers from the dependency injection container.

Namespace

Symfony\Component\HttpKernel\DependencyInjection

Code

public function render($uri, $renderer = 'inline', array $options = array()) {
  if (isset($this->rendererIds[$renderer])) {
    $this
      ->addRenderer($this->container
      ->get($this->rendererIds[$renderer]));
    unset($this->rendererIds[$renderer]);
  }
  return parent::render($uri, $renderer, $options);
}