function theme_menu_link
7.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
2 theme calls to theme_menu_link()
- MenuTreeOutputTestCase::testMenuTreeData in drupal-7.x/
modules/ simpletest/ tests/ menu.test - Validate the generation of a proper menu tree output.
- menu_tree_output in drupal-7.x/
includes/ menu.inc - Returns a rendered menu tree.
File
- drupal-7.x/
includes/ menu.inc, line 1625 - 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";
}