theme_menu_link

Versions
7
theme_menu_link(array $variables)

Generate the HTML output for a menu link and submenu.

Parameters

$variables An associative array containing:

  • element: Structured array data for a menu link.

Return value

A themed HTML string.

Related topics

Code

includes/menu.inc, line 1394

<?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";
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.