Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PathPluginBase.php

function PathPluginBase::validateOptionsForm

Overrides DisplayPluginBase::validateOptionsForm

2 calls to PathPluginBase::validateOptionsForm()
Page::validateOptionsForm in core/modules/views/src/Plugin/views/display/Page.php
Validate the options form.
Page::validateOptionsForm in core/modules/views/src/Plugin/views/display/Page.php
Validate the options form.
1 method overrides PathPluginBase::validateOptionsForm()
Page::validateOptionsForm in core/modules/views/src/Plugin/views/display/Page.php
Validate the options form.

File

core/modules/views/src/Plugin/views/display/PathPluginBase.php, line 460

Class

PathPluginBase
The base display plugin for path/callbacks. This is used for pages and feeds.

Namespace

Drupal\views\Plugin\views\display

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
    parent::validateOptionsForm($form, $form_state);
    if ($form_state->get('section') == 'path') {
        $errors = $this->validatePath($form_state->getValue('path'));
        foreach ($errors as $error) {
            $form_state->setError($form['path'], $error);
        }
        // Automatically remove '/' and trailing whitespace from path.
        $form_state->setValue('path', trim($form_state->getValue('path'), '/ '));
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal