W3cubDocs

/Drupal 8

public function BlockBase::validateConfigurationForm

public BlockBase::validateConfigurationForm(array &$form, FormStateInterface $form_state)

Most block plugins should not override this method. To add validation for a specific block type, override BlockBase::blockValidate().

Overrides PluginFormInterface::validateConfigurationForm

See also

\Drupal\Core\Block\BlockBase::blockValidate()

File

core/lib/Drupal/Core/Block/BlockBase.php, line 199

Class

BlockBase
Defines a base block implementation that most blocks plugins will extend.

Namespace

Drupal\Core\Block

Code

public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
  // Remove the admin_label form item element value so it will not persist.
  $form_state->unsetValue('admin_label');

  $this->blockValidate($form, $form_state);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Block!BlockBase.php/function/BlockBase::validateConfigurationForm/8.1.x