You are here

public function PlaceholderGenerator::canCreatePlaceholder in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Render/PlaceholderGenerator.php \Drupal\Core\Render\PlaceholderGenerator::canCreatePlaceholder()
  2. 9 core/lib/Drupal/Core/Render/PlaceholderGenerator.php \Drupal\Core\Render\PlaceholderGenerator::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);
}