Renders an ESI tag.
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:
string
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;
}