You are here

public function FileSize::buildOptionsForm in Views (for Drupal 7) 8.3

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

lib/Drupal/views/Plugin/views/field/FileSize.php, line 31
Definition of Drupal\views\Plugin\views\field\FileSize.

Class

FileSize
Render a numeric value as a size.

Namespace

Drupal\views\Plugin\views\field

Code

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