private function Esi::handleEsiIncludeTag

Handles an ESI include tag (called internally).

Parameters

array $attributes An array containing the attributes.:

Return value

string The response content for the include.

Throws

\RuntimeException

File

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

Class

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

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

private function handleEsiIncludeTag($attributes) {
  $options = array();
  preg_match_all('/(src|onerror|alt)="([^"]*?)"/', $attributes[1], $matches, PREG_SET_ORDER);
  foreach ($matches as $set) {
    $options[$set[1]] = $set[2];
  }
  if (!isset($options['src'])) {
    throw new \RuntimeException('Unable to process an ESI tag without a "src" attribute.');
  }
  return sprintf('<?php echo $this->esi->handle($this, \'%s\', \'%s\', %s) ?>' . "\n", $options['src'], isset($options['alt']) ? $options['alt'] : null, isset($options['onerror']) && 'continue' == $options['onerror'] ? 'true' : 'false');
}