Back to Menu class

Method menuItemList

public static string
(mixed $name, mixed $selected = null, mixed $attribs = null, mixed $config = array())
Displays an HTML select list of menu items.
Parameters
  • string $name The name of the control.
  • string $selected The value of the selected option.
  • string $attribs Attributes for the control.
  • array $config An array of options for the control [id, published, checkacl, clientid].
Returns
  • string
Since
  • 1.6
Class: Menu
Project: Joomla

Method menuItemList - Source code

/**
 * Displays an HTML select list of menu items.
 *
 * @param   string  $name      The name of the control.
 * @param   string  $selected  The value of the selected option.
 * @param   string  $attribs   Attributes for the control.
 * @param   array   $config    An array of options for the control [id, published, checkacl, clientid].
 *
 * @return  string
 *
 * @since   1.6
 */
public static function menuItemList($name, $selected = null, $attribs = null, $config = array())
{
    static $count;
    $options = static::menuItems($config);
    return HTMLHelper::_('select.genericlist', $options, $name, array('id' => $config['id'] ?? 'assetgroups_' . ++$count, 'list.attr' => $attribs ?? 'class="inputbox" size="1"', 'list.select' => (int) $selected, 'list.translate' => false));
}