You are here

function me_path_autocomplete in Menu Editor 7

Page callback for 'mepac/autocomplete'.

Finds nodes and URL aliases based on title. Sets a http header, and prints json output.

Parameters

string $string: Title of element to find.

See also

mpac_autocomplete()

1 string reference to 'me_path_autocomplete'
me_path_autocomplete_menu in me_path_autocomplete/me_path_autocomplete.module
Implements hook_menu().

File

me_path_autocomplete/me_path_autocomplete.module, line 45
Find node paths on menu item creation via autocomplete.

Code

function me_path_autocomplete($string = NULL) {
  $args = func_get_args();

  /** @noinspection SuspiciousAssignmentsInspection */
  $string = implode('/', $args);
  $matches = _me_path_autocomplete_get_matches($string);
  drupal_json_output($matches);
}