You are here

class DirectRenderStrategy in Render cache 7.2

Direct fallback to render placeholders.

Hierarchy

Expanded class hierarchy of DirectRenderStrategy

File

src/RenderCache/RenderStrategy/DirectRenderStrategy.php, line 14
Contains \Drupal\render_cache\RenderCache\RenderStrategy\DirectRenderStrategy

Namespace

Drupal\render_cache\RenderCache\RenderStrategy
View source
class DirectRenderStrategy extends BaseRenderStrategy {

  /**
   * {@inheritdoc}
   */
  public function render(array $args) {
    $placeholders = array();
    foreach ($args as $placeholder => $ph_object) {
      $rcc = render_cache_get_controller($ph_object['type']);
      $rcc
        ->setContext($ph_object['context']);
      $objects = array(
        $ph_object['id'] => $ph_object['object'],
      );
      $build = $rcc
        ->viewPlaceholders($objects);
      $placeholders[$placeholder] = $build;
    }
    return $placeholders;
  }

}

Members