You are here

public function Taxonomy::init in Views (for Drupal 7) 8.3

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

lib/Views/taxonomy/Plugin/views/field/Taxonomy.php, line 35
Definition of Views\taxonomy\Plugin\views\field\Taxonomy.

Class

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

Namespace

Views\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',
  );
}