You are here

public function LayoutBuilderMigrationConfirmForm::getCancelUrl in Panelizer 8.5

Returns the route to go to if the user cancels the action.

Return value

\Drupal\Core\Url A URL object.

Overrides ConfirmFormInterface::getCancelUrl

1 call to LayoutBuilderMigrationConfirmForm::getCancelUrl()
LayoutBuilderMigrationConfirmForm::submitForm in src/Form/LayoutBuilderMigrationConfirmForm.php
Form submission handler.

File

src/Form/LayoutBuilderMigrationConfirmForm.php, line 117

Class

LayoutBuilderMigrationConfirmForm
A confirmation form for migrating an entity display to Layout Builder.

Namespace

Drupal\panelizer\Form

Code

public function getCancelUrl() {
  $display = $this
    ->getDisplay();
  $entity_type_id = $display
    ->getTargetEntityTypeId();
  $parameters = FieldUI::getRouteBundleParameter($this->entityTypeManager
    ->getDefinition($entity_type_id), $display
    ->getTargetBundle());
  $parameters['view_mode_name'] = $display
    ->getMode();
  return Url::fromRoute("entity.entity_view_display.{$entity_type_id}.view_mode", $parameters);
}