class DirectRenderStrategy in Render cache 7.2
Direct fallback to render placeholders.
Hierarchy
- class \Drupal\render_cache\RenderCache\RenderStrategy\BaseRenderStrategy extends \Drupal\Component\Plugin\PluginBase implements RenderStrategyInterface
- class \Drupal\render_cache\RenderCache\RenderStrategy\DirectRenderStrategy
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\RenderStrategyView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DirectRenderStrategy:: |
public | function |
Overrides RenderStrategyInterface:: |