API16

JHtmlMenu/menus

From Joomla! Documentation

< API16:JHtmlMenu

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Get a list of the available menus.


<! removed transcluded page call, red link never existed >

Syntax[edit]

array Cached array of the menus()


Returns[edit]

string

Defined in[edit]

libraries/joomla/html/html/menu.php

Importing[edit]

jimport( 'joomla.html.html.menu' );

Source Body[edit]

public static function menus()
{
        if (empty(self::$menus))
        {
                $db = &JFactory::getDbo();
                $db->setQuery(
                        'SELECT menutype As value, title As text' .
                        ' FROM #__menu_types' .
                        ' ORDER BY title'
                );
                self::$menus = $db->loadObjectList();
        }

        return self::$menus;
}


<! removed transcluded page call, red link never existed >

Examples[edit]

Code Examples[edit]