function DataFieldRow::init

Same name in other branches
  1. 9 core/modules/rest/src/Plugin/views/row/DataFieldRow.php \Drupal\rest\Plugin\views\row\DataFieldRow::init()
  2. 8.9.x core/modules/rest/src/Plugin/views/row/DataFieldRow.php \Drupal\rest\Plugin\views\row\DataFieldRow::init()
  3. 11.x core/modules/rest/src/Plugin/views/row/DataFieldRow.php \Drupal\rest\Plugin\views\row\DataFieldRow::init()

Overrides PluginBase::init

File

core/modules/rest/src/Plugin/views/row/DataFieldRow.php, line 47

Class

DataFieldRow
Plugin which displays fields as raw data.

Namespace

Drupal\rest\Plugin\views\row

Code

public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) {
    parent::init($view, $display, $options);
    if (!empty($this->options['field_options'])) {
        $options = (array) $this->options['field_options'];
        // Prepare a trimmed version of replacement aliases.
        $aliases = static::extractFromOptionsArray('alias', $options);
        $this->replacementAliases = array_filter(array_map('trim', $aliases));
        // Prepare an array of raw output field options.
        $this->rawOutputOptions = static::extractFromOptionsArray('raw_output', $options);
    }
}

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