Definition

theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL)
drupal/includes/menu.inc, line 1250

Description

Generate the HTML output for a menu item and submenu.

Related topics

Namesort iconDescription
Default theme implementationsFunctions and templates that present output to the user, and can be implemented by themes.
Menu systemDefine the navigation menus, and route page requests to code based on URLs.

Code

function theme_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
  if (!empty($extra_class)) {
    $class .= ' ' . $extra_class;
  }
  if ($in_active_trail) {
    $class .= ' active-trail';
  }
  return '<li class="' . $class . '">' . $link . $menu . "</li>\n";
}