function BlockListBuilder::validateForm
Same name 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()
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.