public function ViewEmbed::validateForm in Dashboards with Layout Builder 2.0.x
Same name and namespace in other branches
- 8 src/Plugin/Dashboard/ViewEmbed.php \Drupal\dashboards\Plugin\Dashboard\ViewEmbed::validateForm()
Validate settings form.
Parameters
array $form: Default form.
\Drupal\Core\Form\FormStateInterface $form_state: Default form.
array $configuration: Configuration.
Overrides DashboardBase::validateForm
File
- src/
Plugin/ Dashboard/ ViewEmbed.php, line 70
Class
- ViewEmbed
- Show account info.
Namespace
Drupal\dashboards\Plugin\DashboardCode
public function validateForm(array $form, FormStateInterface $form_state, array $configuration) : void {
if (!$form_state
->getValue('view')) {
$form_state
->setErrorByName('view', $this
->t('Please provide a view.'));
}
}