You are here

public function ReplicateConfirmForm::getCancelUrl in Replicate UI 8

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

Return value

\Drupal\Core\Url A URL object.

Overrides ConfirmFormInterface::getCancelUrl

File

src/Form/ReplicateConfirmForm.php, line 143

Class

ReplicateConfirmForm

Namespace

Drupal\replicate_ui\Form

Code

public function getCancelUrl() {
  $entity_type_id = $this->routeMatch
    ->getRouteObject()
    ->getDefault('entity_type_id');
  return Url::fromRoute("entity.{$entity_type_id}.canonical", [
    $entity_type_id => $this
      ->getEntity()
      ->id(),
  ]);
}