function BigPipeStrategy::placeholderIsAttributeSafe

Same name in other branches
  1. 8.9.x core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php \Drupal\big_pipe\Render\Placeholder\BigPipeStrategy::placeholderIsAttributeSafe()
  2. 10 core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php \Drupal\big_pipe\Render\Placeholder\BigPipeStrategy::placeholderIsAttributeSafe()
  3. 11.x core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php \Drupal\big_pipe\Render\Placeholder\BigPipeStrategy::placeholderIsAttributeSafe()

Determines whether the given placeholder is attribute-safe or not.

Parameters

string $placeholder: A placeholder.

Return value

bool Whether the placeholder is safe for use in an HTML attribute (in case it's a placeholder for an HTML attribute value or a subset of it).

1 call to BigPipeStrategy::placeholderIsAttributeSafe()
BigPipeStrategy::doProcessPlaceholders in core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php
Transforms placeholders to BigPipe placeholders, either no-JS or JS.

File

core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php, line 182

Class

BigPipeStrategy
Defines the BigPipe placeholder strategy, to send HTML in chunks.

Namespace

Drupal\big_pipe\Render\Placeholder

Code

protected static function placeholderIsAttributeSafe($placeholder) {
    assert(is_string($placeholder));
    return $placeholder[0] !== '<' || $placeholder !== Html::normalize($placeholder);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.