public function DashboardBlockConfigForm::validateForm in Content Planner 8
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 FormBase::validateForm
File
- src/
Form/ DashboardBlockConfigForm.php, line 149
Class
- DashboardBlockConfigForm
- Defines a form that configures forms module settings.
Namespace
Drupal\content_planner\FormCode
public function validateForm(array &$form, FormStateInterface $form_state) {
// Validate form by parent.
parent::validateForm($form, $form_state);
// Get block id from from state.
$block_id = $form_state
->getValue('block_id');
// Create instance.
$instance = $this
->createInstanceFromBlockId($block_id);
// Validate form by plugin.
$instance
->validateForm($form, $form_state);
}