You are here

private function ConfigEditor::buildCancelLinkUrl in Devel 8.3

Same name and namespace in other branches
  1. 8 src/Form/ConfigEditor.php \Drupal\devel\Form\ConfigEditor::buildCancelLinkUrl()
  2. 8.2 src/Form/ConfigEditor.php \Drupal\devel\Form\ConfigEditor::buildCancelLinkUrl()
  3. 4.x src/Form/ConfigEditor.php \Drupal\devel\Form\ConfigEditor::buildCancelLinkUrl()

Builds the cancel link url for the form.

Return value

\Drupal\Core\Url Cancel url

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

File

src/Form/ConfigEditor.php, line 140

Class

ConfigEditor
Edit config variable form.

Namespace

Drupal\devel\Form

Code

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