Back to CMSApplication class

Method getMenu

public \Joomla\CMS\Menu\AbstractMenu
getMenu
(mixed $name = null, mixed $options = array())
Returns the application \JMenu object.
Parameters
  • string $name The name of the application/client.
  • array $options An optional associative array of configuration settings.
Returns
  • \Joomla\CMS\Menu\AbstractMenu
Since
  • 3.2

Method getMenu - Source code

/**
 * Returns the application \JMenu object.
 *
 * @param   string  $name     The name of the application/client.
 * @param   array   $options  An optional associative array of configuration settings.
 *
 * @return  AbstractMenu
 *
 * @since   3.2
 */
public function getMenu($name = null, $options = array())
{
    if (!isset($name)) {
        $name = $this->getName();
    }
    // Inject this application object into the \JMenu tree if one isn't already specified
    if (!isset($options['app'])) {
        $options['app'] = $this;
    }
    return AbstractMenu::getInstance($name, $options);
}