You are here

public function File::buildOptionsForm in Zircon Profile 8.0

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

Provide link to file option

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/file/src/Plugin/views/field/File.php, line 48
Contains \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 buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['link_to_file'] = array(
    '#title' => $this
      ->t('Link this field to download the file'),
    '#description' => $this
      ->t("Enable to override this field's links."),
    '#type' => 'checkbox',
    '#default_value' => !empty($this->options['link_to_file']),
  );
  parent::buildOptionsForm($form, $form_state);
}