function BlockListBuilder::validateForm
Same name and namespace in other branches
- 8.9.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::validateForm()
- 10 core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::validateForm()
- 11.x core/modules/block/src/BlockListBuilder.php \Drupal\block\BlockListBuilder::validateForm()
Form validation handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides FormInterface::validateForm
File
-
core/
modules/ block/ src/ BlockListBuilder.php, line 374
Class
- BlockListBuilder
- Defines a class to build a listing of block entities.
Namespace
Drupal\blockCode
public function validateForm(array &$form, FormStateInterface $form_state) {
if (empty($form_state->getValue('blocks'))) {
$form_state->setErrorByName('blocks', $this->t('No blocks settings to update.'));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.