public function UrlPath::validateOptionsForm in Views URL Path Arguments 8
Same name in this branch
- 8 src/Plugin/views/argument_default/UrlPath.php \Drupal\views_url_path_arguments\Plugin\views\argument_default\UrlPath::validateOptionsForm()
- 8 src/Plugin/views/argument_validator/UrlPath.php \Drupal\views_url_path_arguments\Plugin\views\argument_validator\UrlPath::validateOptionsForm()
Provides the default form for validating options.
Overrides ArgumentValidatorPluginBase::validateOptionsForm
File
- src/
Plugin/ views/ argument_validator/ UrlPath.php, line 107
Class
- UrlPath
- Convert an entity id to its url path.
Namespace
Drupal\views_url_path_arguments\Plugin\views\argument_validatorCode
public function validateOptionsForm(&$form, FormStateInterface $form_state) {
$values = $form_state
->getValue($form['#parents']);
if (isset($values['segments']) && $values['segments'] !== trim($values['segments'], '/')) {
$form_state
->setError($form['segments'], t('The URL segments must not contain a leading or trailing slash (/).'));
}
}