function File::__construct

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

Constructs a File object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin ID for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\File\FileUrlGeneratorInterface $file_url_generator: The file URL generator.

Overrides HandlerBase::__construct

File

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

Class

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

Namespace

Drupal\file\Plugin\views\field

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, FileUrlGeneratorInterface $file_url_generator) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->fileUrlGenerator = $file_url_generator;
}

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