You are here

public function Esi::renderIncludeTag in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpCache/Esi.php \Symfony\Component\HttpKernel\HttpCache\Esi::renderIncludeTag()

Renders an ESI tag.

Parameters

string $uri A URI:

string $alt An alternate URI:

bool $ignoreErrors Whether to ignore errors or not:

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

Return value

string

Overrides SurrogateInterface::renderIncludeTag

File

vendor/symfony/http-kernel/HttpCache/Esi.php, line 178

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;
}