You are here

public function WebformVariantApplyForm::getQuestion in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Form/WebformVariantApplyForm.php \Drupal\webform\Form\WebformVariantApplyForm::getQuestion()

Returns the question to ask the user.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form question. The page title will be set to this value.

Overrides ConfirmFormInterface::getQuestion

File

src/Form/WebformVariantApplyForm.php, line 39

Class

WebformVariantApplyForm
Form for apply a webform variant.

Namespace

Drupal\webform\Form

Code

public function getQuestion() {
  if ($this
    ->isDialog()) {
    return $this->hasMultipleVariants ? $this
      ->t("Apply variants?") : $this
      ->t("Apply variant?");
  }
  else {
    $t_args = [
      '%webform' => $this->webform
        ->label(),
    ];
    return $this->hasMultipleVariants ? $this
      ->t('Apply the selected variants to the %webform webform?', $t_args) : $this
      ->t('Apply variant to the %webform webform?', $t_args);
  }
}