You are here

public function ProfileLocalAction::getOptions in Profile 8

Returns options for rendering a link for the local action.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

Return value

array An associative array of options.

Overrides LocalActionDefault::getOptions

File

src/Plugin/Menu/LocalAction/ProfileLocalAction.php, line 59

Class

ProfileLocalAction
Modifies the local action to add a destination.

Namespace

Drupal\profile\Plugin\Menu\LocalAction

Code

public function getOptions(RouteMatchInterface $route_match) {
  $options = parent::getOptions($route_match);

  // Append the current path as destination to the query string.
  $options['query']['destination'] = $this->redirectDestination
    ->get();
  return $options;
}