public function Esi::renderIncludeTag

Renders an ESI tag.

Parameters

string $uri A URI:

string $alt An alternate URI:

Boolean $ignoreErrors Whether to ignore errors or not:

string $comment A comment to add as an esi:include tag:

Return value

string

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/Esi.php, line 123

Class

Esi
Esi implements the ESI capabilities to Request and Response instances.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function renderIncludeTag($uri, $alt = null, $ignoreErrors = true, $comment = '') {
  $html = sprintf('<esi:include src="%s"%s%s />', $uri, $ignoreErrors ? ' onerror="continue"' : '', $alt ? sprintf(' alt="%s"', $alt) : '');
  if (!empty($comment)) {
    return sprintf("<esi:comment text=\"%s\" />\n%s", $comment, $html);
  }
  return $html;
}