You are here

private function RemoveViewsCustomTable::buildCancelLinkUrl in Views Custom Table 8

Same name and namespace in other branches
  1. 9.0.x src/Form/RemoveViewsCustomTable.php \Drupal\view_custom_table\Form\RemoveViewsCustomTable::buildCancelLinkUrl()

Builds the cancel link url for the form.

Return value

Drupal\Core\Url Cancel url

1 call to RemoveViewsCustomTable::buildCancelLinkUrl()
RemoveViewsCustomTable::buildForm in src/Form/RemoveViewsCustomTable.php
Form constructor.

File

src/Form/RemoveViewsCustomTable.php, line 134

Class

RemoveViewsCustomTable
Add views custom table form.

Namespace

Drupal\view_custom_table\Form

Code

private function buildCancelLinkUrl() {
  $query = $this
    ->getRequest()->query;
  if ($query
    ->has('destination')) {
    $options = UrlHelper::parse($query
      ->get('destination'));
    $url = Url::fromUri('internal:/' . $options['path'], $options);
  }
  else {
    $url = Url::fromRoute('view_custom_table.customtable');
  }
  return $url;
}