You are here

public function StaticContextDeleteForm::getCancelUrl in Page Manager 8.4

Same name and namespace in other branches
  1. 8 page_manager_ui/src/Form/StaticContextDeleteForm.php \Drupal\page_manager_ui\Form\StaticContextDeleteForm::getCancelUrl()

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

Return value

\Drupal\Core\Url A URL object.

Overrides ConfirmFormInterface::getCancelUrl

File

page_manager_ui/src/Form/StaticContextDeleteForm.php, line 41

Class

StaticContextDeleteForm
Provides a form for deleting an access condition.

Namespace

Drupal\page_manager_ui\Form

Code

public function getCancelUrl() {
  $cached_values = $this
    ->getTempstore();

  /** @var $page \Drupal\page_manager\PageInterface */
  $page = $cached_values['page'];
  if ($page
    ->isNew()) {
    return new Url('entity.page.add_step_form', [
      'machine_name' => $this->machine_name,
      'step' => 'contexts',
    ]);
  }
  else {
    $page_variant = $this
      ->getPageVariant($cached_values);
    return new Url('entity.page.edit_form', [
      'machine_name' => $this->machine_name,
      'step' => 'page_variant__' . $page_variant
        ->id() . '__contexts',
    ]);
  }
}