Back to ActionsDropdown class

Method render

public static string
render
(mixed $item = '')
Method to render current dropdown menu
Parameters
  • string $item An item to render.
Returns
  • string HTML markup for the dropdown list
Since
  • 3.2

Method render - Source code

/**
 * Method to render current dropdown menu
 *
 * @param   string  $item  An item to render.
 *
 * @return  string  HTML markup for the dropdown list
 *
 * @since   3.2
 */
public static function render($item = '')
{
    $html = array();
    $html[] = '<button data-bs-toggle="dropdown" class="dropdown-toggle btn btn-sm btn-secondary">';
    $html[] = '<span class="caret"></span>';
    if ($item) {
        $html[] = '<span class="visually-hidden">' . Text::sprintf('JACTIONS', $item) . '</span>';
    }
    $html[] = '</button>';
    $html[] = '<ul class="dropdown-menu">';
    $html[] = implode('', static::$dropDownList);
    $html[] = '</ul>';
    static::$dropDownList = null;
    return implode('', $html);
}