You are here

public function PotxExtractTranslationForm::validateForm in Translation template extractor 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/PotxExtractTranslationForm.php, line 121

Class

PotxExtractTranslationForm
Class PotxExtractTranslationForm.

Namespace

Drupal\potx\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (empty($form_state
    ->getValue('component'))) {
    $form_state
      ->setErrorByName('component', $this
      ->t('You should select a component to export.'));
  }
}