public function Taxonomy::init

Overrides Drupal\views\Plugin\views\field\FieldPluginBase::init().

This method assumes the taxonomy_term_data table. If using another table, we'll need to be more specific.

Overrides FieldPluginBase::init

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/Taxonomy.php, line 35
Definition of Drupal\taxonomy\Plugin\views\field\Taxonomy.

Class

Taxonomy
Field handler to provide simple renderer that allows linking to a taxonomy term.

Namespace

Drupal\taxonomy\Plugin\views\field

Code

public function init(ViewExecutable $view, &$options) {
  parent::init($view, $options);
  $this->additional_fields['vid'] = 'vid';
  $this->additional_fields['tid'] = 'tid';
  $this->additional_fields['vocabulary_machine_name'] = array(
    'table' => 'taxonomy_vocabulary',
    'field' => 'machine_name',
  );
}