public function YamlFormElementBase::validateConfigurationForm in YAML Form 8
Form validation handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().
Overrides PluginFormInterface::validateConfigurationForm
3 calls to YamlFormElementBase::validateConfigurationForm()
- DateBase::validateConfigurationForm in src/
Plugin/ YamlFormElement/ DateBase.php - Form validation handler.
- TextBase::validateConfigurationForm in src/
Plugin/ YamlFormElement/ TextBase.php - Form validation handler.
- TextFormat::validateConfigurationForm in src/
Plugin/ YamlFormElement/ TextFormat.php - Form validation handler.
3 methods override YamlFormElementBase::validateConfigurationForm()
- DateBase::validateConfigurationForm in src/
Plugin/ YamlFormElement/ DateBase.php - Form validation handler.
- TextBase::validateConfigurationForm in src/
Plugin/ YamlFormElement/ TextBase.php - Form validation handler.
- TextFormat::validateConfigurationForm in src/
Plugin/ YamlFormElement/ TextFormat.php - Form validation handler.
File
- src/
YamlFormElementBase.php, line 1401
Class
- YamlFormElementBase
- Provides a base class for a form element.
Namespace
Drupal\yamlformCode
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
$properties = $this
->getConfigurationFormProperties($form, $form_state);
if ($ignored_properties = YamlFormElementHelper::getIgnoredProperties($properties)) {
$t_args = [
'@properties' => YamlFormArrayHelper::toString($ignored_properties),
];
$form_state
->setErrorByName('custom', t('Element contains ignored/unsupported properties: @properties.', $t_args));
}
}