You are here

protected function AJAXactionLink::getDestination in Flag 8.4

Helper method to generate a destination URL parameter.

Return value

string A string containing a destination URL parameter.

Overrides ActionLinkTypeBase::getDestination

File

src/Plugin/ActionLink/AJAXactionLink.php, line 67

Class

AJAXactionLink
Provides the AJAX link type.

Namespace

Drupal\flag\Plugin\ActionLink

Code

protected function getDestination() {
  if ($destination = $this->request->query
    ->get('destination')) {

    // Workaround the default behavior so we keep the GET[destination] value
    // no matter how many times the flag is clicked.
    return $destination;
  }
  parent::getDestination();
}