You are here

public function EntityFlagActionForm::getCancelUrl in farmOS 2.x

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 EntityFlagActionForm::getCancelUrl()
EntityFlagActionForm::submitForm in modules/core/flag/src/Form/EntityFlagActionForm.php
Form submission handler.

File

modules/core/flag/src/Form/EntityFlagActionForm.php, line 126

Class

EntityFlagActionForm
Provides an entity flag action form.

Namespace

Drupal\farm_flag\Form

Code

public function getCancelUrl() {
  if ($this->entityType
    ->hasLinkTemplate('collection')) {
    return new Url('entity.' . $this->entityType
      ->id() . '.collection');
  }
  else {
    return new Url('<front>');
  }
}