You are here

public function TourForm::tipValidate in Tour UI 8

Validate handler.

File

src/Form/TourForm.php, line 262

Class

TourForm
Form controller for the tour entity edit forms.

Namespace

Drupal\tour_ui\Form

Code

public function tipValidate($form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('new')) {
    $form_state
      ->setError($form['tips']['new']['new'], $this
      ->t('Select a new tip.'));
  }
}