function MachineName::buildOptionsForm

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

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/field/MachineName.php, line 58

Class

MachineName
Field handler which allows to show machine name content as human name.

Namespace

Drupal\views\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $form['machine_name'] = [
        '#title' => $this->t('Output machine name'),
        '#description' => $this->t('Display field as machine name.'),
        '#type' => 'checkbox',
        '#default_value' => !empty($this->options['machine_name']),
    ];
}

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