You are here

public function ExtlinkExtraController::leave in External Links Extra 8

Render the markup for the exit modal.

Return value

array

See also

extlink_extra_preprocess_extlink_extra_leaving()

1 string reference to 'ExtlinkExtraController::leave'
extlink_extra.routing.yml in ./extlink_extra.routing.yml
extlink_extra.routing.yml

File

src/Controller/ExtlinkExtraController.php, line 95

Class

ExtlinkExtraController

Namespace

Drupal\extlink_extra\Controller

Code

public function leave() {

  // Just return the template. Variables will be inserted
  // in extlink_extra_preprocess_extlink_extra_leaving().
  $output = [
    '#theme' => 'extlink_extra_leaving',
  ];

  // If we are using Colorbox we will add colorbox=1 to the query string of the
  // alert page. This causes a premature exit which saves execution time and
  // does not render the rest of the page.
  if ($this->requestStack
    ->getCurrentRequest()->request
    ->get('colorbox')) {
    $html = $this->renderer
      ->render($output);
    return new HtmlResponse($html);
  }
  return $output;
}