You are here

public function WebformConfigEntityDeleteFormBase::getQuestion in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Form/WebformConfigEntityDeleteFormBase.php \Drupal\webform\Form\WebformConfigEntityDeleteFormBase::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 EntityDeleteFormTrait::getQuestion

1 call to WebformConfigEntityDeleteFormBase::getQuestion()
WebformConfigEntityDeleteFormBase::buildForm in src/Form/WebformConfigEntityDeleteFormBase.php
Form constructor.

File

src/Form/WebformConfigEntityDeleteFormBase.php, line 37

Class

WebformConfigEntityDeleteFormBase
Provides a generic base class for a webform entity deletion form.

Namespace

Drupal\webform\Form

Code

public function getQuestion() {
  if ($this
    ->isDialog()) {
    $t_args = [
      '@entity-type' => $this
        ->getEntity()
        ->getEntityType()
        ->getSingularLabel(),
      '@label' => $this
        ->getEntity()
        ->label(),
    ];
    return $this
      ->t("Delete '@label' @entity-type?", $t_args);
  }
  else {
    $t_args = [
      '@entity-type' => $this
        ->getEntity()
        ->getEntityType()
        ->getSingularLabel(),
      '%label' => $this
        ->getEntity()
        ->label(),
    ];
    return $this
      ->t('Delete %label @entity-type?', $t_args);
  }
}