You are here

protected function DidYouMeanSpellCheck::getSuggestionLink in Search API Spellcheck 8.3

Gets the suggestion link.

Parameters

string $new_keys: The suggestion.

string $filter_name: The parameter name of text search filter.

Return value

\Drupal\Core\Link The suggestion link.

2 calls to DidYouMeanSpellCheck::getSuggestionLink()
DidYouMeanSpellCheck::render in src/Plugin/views/area/DidYouMeanSpellCheck.php
Render the area.
SuggestionsSpellCheck::render in src/Plugin/views/area/SuggestionsSpellCheck.php
Render the area.

File

src/Plugin/views/area/DidYouMeanSpellCheck.php, line 183

Class

DidYouMeanSpellCheck
Provides an area for messages.

Namespace

Drupal\search_api_spellcheck\Plugin\views\area

Code

protected function getSuggestionLink($new_keys, $filter_name) {
  $url = Url::fromRoute('<current>', [
    $filter_name => $new_keys,
  ] + $this
    ->getCurrentQuery());
  return Link::fromTextAndUrl($new_keys, $url);
}