Back to ActionsDropdown class

Method addCustomItem

public static void
addCustomItem
(mixed $label, mixed $icon = '', mixed $id = '', mixed $task = '')
Append a custom item to current dropdown menu.
Parameters
  • string $label The label of the item.
  • string $icon The icon classname.
  • string $id The item id.
  • string $task The task.
Returns
  • void
Since
  • 3.2

Method addCustomItem - Source code

/**
 * Append a custom item to current dropdown menu.
 *
 * @param   string  $label  The label of the item.
 * @param   string  $icon   The icon classname.
 * @param   string  $id     The item id.
 * @param   string  $task   The task.
 *
 * @return  void
 *
 * @since   3.2
 */
public static function addCustomItem($label, $icon = '', $id = '', $task = '')
{
    static::$dropDownList[] = '<li>' . HTMLHelper::link('javascript://', ($icon ? LayoutHelper::render('joomla.icon.iconclass', ['icon' => $icon]) : '') . $label, ['onclick' => 'Joomla.listItemTask(\'' . $id . '\', \'' . $task . '\')']) . '</li>';
}