function theme_menu_link

7.x menu.inc theme_menu_link(array $variables)
8.x menu.inc theme_menu_link(array $variables)

Returns HTML for a menu link and submenu.

Parameters

$variables: An associative array containing:

  • element: Structured array data for a menu link.

Related topics

4 string references to the theme hook from theme_menu_link()

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

drupal_common_theme in drupal/includes/common.inc
Provides theme registration for themes across .inc files.
MenuTreeOutputTestCase::testMenuTreeData in drupal/modules/simpletest/tests/menu.test
Validate the generation of a proper menu tree output.
menu_link_save in drupal/includes/menu.inc
Saves a menu link.
menu_tree_output in drupal/includes/menu.inc
Returns an output structure for rendering a menu tree.

File

drupal/includes/menu.inc, line 1635
API for the Drupal menu system.

Code

function theme_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . "</li>\n";
}