You are here

public function ModalPublishedForm::getQuestion in Modal 8.3

Same name and namespace in other branches
  1. 8.2 src/Form/ModalPublishedForm.php \Drupal\modal_page\Form\ModalPublishedForm::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/ModalPublishedForm.php, line 17

Class

ModalPublishedForm
Class: ModalPublishedForm.

Namespace

Drupal\modal_page\Form

Code

public function getQuestion() {
  $entity = $this
    ->getEntity();
  if ($entity->published->value) {
    return $this
      ->t('Are you sure you want to unpublish entity %title?', [
      '%title' => $this->entity
        ->label(),
    ]);
  }
  return $this
    ->t('Are you sure you want to publish entity %title?', [
    '%title' => $this->entity
      ->label(),
  ]);
}