You are here

public function SearchApiSpellcheck::getSuggestionLinkForGet in Search API Spellcheck 7

Accepts a a query string key which is used to get the value submitted and

returns a link to the current page with whatever value is in the query string replaced with a suggestion.

This method is for search pages which submit the search key string as a field in the query string such as: /search/?key=foo%20bar

Parameters

string $get: Query string field.

See also

getSuggestionLinkForArg()

File

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

Class

SearchApiSpellcheck

Code

public function getSuggestionLinkForGet($get) {
  if (isset($_GET[$get])) {
    $original = $_GET[$get];
    if (is_string($original) && ($suggestion = $this
      ->getSuggestion($original))) {
      return new SearchApiSpellcheckSuggestionLink($suggestion, 'get', $get);
    }
  }
  return FALSE;
}