You are here

public function SearchApiSpellcheck::getSuggestionLinkForArg in Search API Spellcheck 7

Accepts a Drupal arg number which is used to get the value submitted and returns a link to the current page with whatever value is in the URL argument replaced with a suggestion.

This method is for search pages which submit the search key string as an argument in a url such as: /search/foo%20bar

Parameters

int $arg: Drupal URL argument.

Return value

SearchApiSpellcheckSuggestionLink if any suggestions could be applied. if not then returns FALSE.

See also

getSuggestionLinkForGet()

File

includes/SearchApiSpellcheck.inc, line 131
Spellcheck Service Interface and Class.

Class

SearchApiSpellcheck

Code

public function getSuggestionLinkForArg($arg) {
  if ($suggestion = $this
    ->getSuggestion(arg($arg))) {
    return new SearchApiSpellcheckSuggestionLink($suggestion, 'arg', $arg);
  }
  return FALSE;
}