public function File::init

Constructor to provide additional field to add.

Overrides FieldPluginBase::init

File

drupal/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php, line 29
Definition of Drupal\file\Plugin\views\field\File.

Class

File
Field handler to provide simple renderer that allows linking to a file.

Namespace

Drupal\file\Plugin\views\field

Code

public function init(ViewExecutable $view, &$options) {
  parent::init($view, $options);
  if (!empty($options['link_to_file'])) {
    $this->additional_fields['uri'] = 'uri';
  }
}