Back to AbstractMenu class

Method getMenu

public \Joomla\CMS\Menu\MenuItem[]
getMenu
()
Getter for the menu array
Returns
  • \Joomla\CMS\Menu\MenuItem[]
Since
  • 1.5
Class: AbstractMenu
Project: Joomla

Method getMenu - Source code

/**
 * Getter for the menu array
 *
 * @return  MenuItem[]
 *
 * @since   1.5
 */
public function getMenu()
{
    if (!$this->itemsLoaded) {
        $this->load();
        foreach ($this->items as $item) {
            if ($item->home) {
                $this->default[trim($item->language)] = $item->id;
            }
        }
        $this->itemsLoaded = true;
    }
    return $this->items;
}