function Markup::render

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

Overrides FieldPluginBase::render

File

core/modules/views/src/Plugin/views/field/Markup.php, line 45

Class

Markup
Handler to run a field through check_markup, using a companion format field.

Namespace

Drupal\views\Plugin\views\field

Code

public function render(ResultRow $values) {
    $value = $this->getValue($values);
    if (is_array($this->format)) {
        $format = $this->getValue($values, 'format');
    }
    else {
        $format = $this->format;
    }
    if ($value) {
        $value = str_replace('<!--break-->', '', $value);
        return check_markup($value, $format);
    }
}

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