function UncacheableFieldHandlerTrait::postRender

Same name in other branches
  1. 8.9.x core/modules/views/src/Plugin/views/field/UncacheableFieldHandlerTrait.php \Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait::postRender()
  2. 10 core/modules/views/src/Plugin/views/field/UncacheableFieldHandlerTrait.php \Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait::postRender()
  3. 11.x core/modules/views/src/Plugin/views/field/UncacheableFieldHandlerTrait.php \Drupal\views\Plugin\views\field\UncacheableFieldHandlerTrait::postRender()

See also

\Drupal\views\Plugin\views\Field\FieldHandlerInterface::postRender()

File

core/modules/views/src/Plugin/views/field/UncacheableFieldHandlerTrait.php, line 26

Class

UncacheableFieldHandlerTrait
Trait encapsulating the logic for uncacheable field handlers.

Namespace

Drupal\views\Plugin\views\field

Code

public function postRender(ResultRow $row, $output) {
    $placeholder = $this->getFieldTokenPlaceholder();
    $value = $this->doRender($row);
    $this->last_render = str_replace($placeholder, $value, $output);
    return [
        $placeholder => $value,
    ];
}

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