function PlaceholderGenerator::canCreatePlaceholder

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/PlaceholderGenerator.php \Drupal\Core\Render\PlaceholderGenerator::canCreatePlaceholder()
  2. 10 core/lib/Drupal/Core/Render/PlaceholderGenerator.php \Drupal\Core\Render\PlaceholderGenerator::canCreatePlaceholder()
  3. 11.x core/lib/Drupal/Core/Render/PlaceholderGenerator.php \Drupal\Core\Render\PlaceholderGenerator::canCreatePlaceholder()

Overrides PlaceholderGeneratorInterface::canCreatePlaceholder

File

core/lib/Drupal/Core/Render/PlaceholderGenerator.php, line 35

Class

PlaceholderGenerator
Turns a render array into a placeholder.

Namespace

Drupal\Core\Render

Code

public function canCreatePlaceholder(array $element) {
    // If generated by a #lazy_builder callback, placeholdering is possible.
    return isset($element['#lazy_builder']) && (!isset($element['#create_placeholder']) || $element['#create_placeholder'] !== FALSE);
}

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