function FileSize::buildOptionsForm

Same name in other branches
  1. 9 core/modules/views/src/Plugin/views/field/FileSize.php \Drupal\views\Plugin\views\field\FileSize::buildOptionsForm()
  2. 8.9.x core/modules/views/src/Plugin/views/field/FileSize.php \Drupal\views\Plugin\views\field\FileSize::buildOptionsForm()
  3. 11.x core/modules/views/src/Plugin/views/field/FileSize.php \Drupal\views\Plugin\views\field\FileSize::buildOptionsForm()

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/field/FileSize.php, line 32

Class

FileSize
Render a numeric value as a size.

Namespace

Drupal\views\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $form['file_size_display'] = [
        '#title' => $this->t('File size display'),
        '#type' => 'select',
        '#options' => [
            'formatted' => $this->t('Formatted (in KB or MB)'),
            'bytes' => $this->t('Raw bytes'),
        ],
    ];
}

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