You are here

public function FlagDisableConfirmForm::getConfirmText in Flag 8.4

Returns a caption for the button that confirms the action.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form confirmation text.

Overrides ConfirmFormBase::getConfirmText

File

src/Form/FlagDisableConfirmForm.php, line 69

Class

FlagDisableConfirmForm
Provides the flag enable/disable confirmation form.

Namespace

Drupal\flag\Form

Code

public function getConfirmText() {
  if ($this->flag
    ->status()) {
    return $this
      ->t('Disable');
  }
  return $this
    ->t('Enable');
}