function DiscardLayoutChangesForm::getDescription

Overrides ConfirmFormBase::getDescription

File

core/modules/layout_builder/src/Form/DiscardLayoutChangesForm.php, line 85

Class

DiscardLayoutChangesForm
Discards any pending changes to the layout.

Namespace

Drupal\layout_builder\Form

Code

public function getDescription() {
  try {
    $entity = $this->sectionStorage
      ->getContextValue('entity');
    return $this->t('Any unsaved changes to the layout for %label will be discarded. This action cannot be undone.', [
      '%label' => $entity->label(),
    ]);
  } catch (ContextException) {
    // If the entity is not available, just return a generic message.
    return $this->t('Any unsaved changes to the layout will be discarded. This action cannot be undone.');
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.