theme_menu_link

  1. drupal
    1. 8
    2. 7
Versions
8 – 7 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

Code

includes/menu.inc, line 1600

<?php
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";
}
?>