function AreaPluginBase::buildOptionsForm

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

Overrides HandlerBase::buildOptionsForm

7 calls to AreaPluginBase::buildOptionsForm()
DisplayLink::buildOptionsForm in core/modules/views/src/Plugin/views/area/DisplayLink.php
HTTPStatusCode::buildOptionsForm in core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
Result::buildOptionsForm in core/modules/views/src/Plugin/views/area/Result.php
TestExample::buildOptionsForm in core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
Title::buildOptionsForm in core/modules/views/src/Plugin/views/area/Title.php

... See full list

7 methods override AreaPluginBase::buildOptionsForm()
DisplayLink::buildOptionsForm in core/modules/views/src/Plugin/views/area/DisplayLink.php
HTTPStatusCode::buildOptionsForm in core/modules/views/src/Plugin/views/area/HTTPStatusCode.php
Result::buildOptionsForm in core/modules/views/src/Plugin/views/area/Result.php
TestExample::buildOptionsForm in core/modules/views/tests/modules/views_test_data/src/Plugin/views/area/TestExample.php
Title::buildOptionsForm in core/modules/views/src/Plugin/views/area/Title.php

... See full list

File

core/modules/views/src/Plugin/views/area/AreaPluginBase.php, line 80

Class

AreaPluginBase
Base class for area handler plugins.

Namespace

Drupal\views\Plugin\views\area

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    if ($form_state->get('type') != 'empty') {
        $form['empty'] = [
            '#type' => 'checkbox',
            '#title' => $this->t('Display even if view has no result'),
            '#default_value' => $this->options['empty'] ?? 0,
        ];
    }
}

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