You are here

public function FlagDisableConfirmForm::getQuestion in Flag 8.4

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/FlagDisableConfirmForm.php, line 40

Class

FlagDisableConfirmForm
Provides the flag enable/disable confirmation form.

Namespace

Drupal\flag\Form

Code

public function getQuestion() {
  if ($this->flag
    ->status()) {
    return $this
      ->t('Disable flag @name?', [
      '@name' => $this->flag
        ->label(),
    ]);
  }
  return $this
    ->t('Enable flag @name?', [
    '@name' => $this->flag
      ->label(),
  ]);
}