To get the menu:

$menu = JFactory::getApplication()->getMenu();

To get menu items by attribute:

$items = $menu->getItems('menutype', 'mainmenu');

The variable $items is an array of menu item objects. It contains the following:

  • id
  • menutype
  • title
  • alias
  • note
  • route
  • link
  • type
  • level
  • language
  • browserNav
  • access
  • params:protected
  • home
  • img
  • template_style_id
  • component_id
  • parent_id
  • component
  • tree (Array)
  • query (Array)

To get the active menu, and then its parameters:

$current = $menu->getActive();
$params = $current->params;
$yourParameter = $params->get('yourParameter');

To get the default item by language code:

$default = $menu->getDefault();