You are here

public function FileName::buildOptionsForm in File Entity (fieldable files) 8.2

Provide link to file option.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/FileName.php, line 45

Class

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

Namespace

Drupal\file_entity\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['link_to_file'] = array(
    '#title' => t('Link this field to view the file'),
    '#description' => t("Enable to override this field's links."),
    '#type' => 'checkbox',
    '#default_value' => !empty($this->options['link_to_file']),
  );
  parent::buildOptionsForm($form, $form_state);
}