function Custom::buildOptionsForm

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

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/field/Custom.php, line 48

Class

Custom
A handler to provide a field that is completely custom by the administrator.

Namespace

Drupal\views\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    // Remove the checkbox
    unset($form['alter']['alter_text']);
    unset($form['alter']['text']['#states']);
    unset($form['alter']['help']['#states']);
    $form['#pre_render'][] = [
        $this,
        'preRenderCustomForm',
    ];
}

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