public function PathPluginBase::validateOptionsForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/views/display/PathPluginBase.php \Drupal\views\Plugin\views\display\PathPluginBase::validateOptionsForm()
- 9 core/modules/views/src/Plugin/views/display/PathPluginBase.php \Drupal\views\Plugin\views\display\PathPluginBase::validateOptionsForm()
Validates the options form.
Overrides DisplayPluginInterface::validateOptionsForm
1 call to PathPluginBase::validateOptionsForm()
- Page::validateOptionsForm in core/
modules/ views/ src/ Plugin/ views/ display/ Page.php - Validates the options form.
1 method overrides PathPluginBase::validateOptionsForm()
- Page::validateOptionsForm in core/
modules/ views/ src/ Plugin/ views/ display/ Page.php - Validates the options form.
File
- core/
modules/ views/ src/ Plugin/ views/ display/ PathPluginBase.php, line 459
Class
- PathPluginBase
- The base display plugin for path/callbacks. This is used for pages and feeds.
Namespace
Drupal\views\Plugin\views\displayCode
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'), '/ '));
}
}