You are here

public function File::init in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/file/src/Plugin/views/field/File.php \Drupal\file\Plugin\views\field\File::init()
  2. 10 core/modules/file/src/Plugin/views/field/File.php \Drupal\file\Plugin\views\field\File::init()

Initialize the plugin.

Parameters

\Drupal\views\ViewExecutable $view: The view object.

\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The display handler.

array $options: The options configured for this plugin.

Overrides FieldPluginBase::init

File

core/modules/file/src/Plugin/views/field/File.php, line 60

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, DisplayPluginBase $display, array &$options = NULL) {
  parent::init($view, $display, $options);
  if (!empty($options['link_to_file'])) {
    $this->additional_fields['uri'] = 'uri';
  }
}