You are here

public function DisplayTest::validateOptionsForm in Views (for Drupal 7) 8.3

Overrides Drupal\views\Plugin\views\display\DisplayPluginBase::validateOptionsForm().

Overrides DisplayPluginBase::validateOptionsForm

File

tests/views_test_data/lib/Drupal/views_test_data/Plugin/views/display/DisplayTest.php, line 87
Definition of Drupal\views_test_data\Plugin\views\display\DisplayTest.

Class

DisplayTest
Defines a Display test plugin.

Namespace

Drupal\views_test_data\Plugin\views\display

Code

public function validateOptionsForm(&$form, &$form_state) {
  parent::validateOptionsForm($form, $form_state);
  watchdog('views', $form_state['values']['test_option']);
  switch ($form_state['section']) {
    case 'test_option':
      if (!trim($form_state['values']['test_option'])) {
        form_error($form['test_option'], t('You cannot have an empty option.'));
      }
      break;
  }
}