protected static function menuDropdown($label, $url, $items, $htmlOptions, $depth = 0)
    {
        self::addCssClass($depth === 0 ? 'dropdown' : 'dropdown-submenu', $htmlOptions);
        TbArray::defaultValue('role', 'menuitem', $htmlOptions);
        $linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
        $menuOptions = TbArray::popValue('menuOptions', $htmlOptions, array());
        self::addCssClass('dropdown-menu', $menuOptions);
        if ($depth === 0) {
            $defaultId = parent::ID_PREFIX . parent::$count++;
            TbArray::defaultValue('id', $defaultId, $menuOptions);
            $menuOptions['aria-labelledby'] = $menuOptions['id'];
            $menuOptions['role'] = 'menu';
        }
        $output = self::openTag('li', $htmlOptions);
        $output .= self::dropdownToggleMenuLink($label, $url, $linkOptions, $depth);
        $output .= self::menu($items, $menuOptions, $depth + 1);
        $output .= '</li>';
        return $output;
    }
protected static function menuDropdown($label, $url, $items, $htmlOptions, $depth = 0)
    {
        self::addCssClass($depth === 0 ? 'dropdown' : 'dropdown-submenu', $htmlOptions);
        TbArray::defaultValue('role', 'menuitem', $htmlOptions);
        $linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
        $menuOptions = TbArray::popValue('menuOptions', $htmlOptions, array());
        self::addCssClass('dropdown-menu', $menuOptions);
        if ($depth === 0) {
            $defaultId = parent::ID_PREFIX . parent::$count++;
            TbArray::defaultValue('id', $defaultId, $menuOptions);
            $menuOptions['aria-labelledby'] = $menuOptions['id'];
            $menuOptions['role'] = 'menu';
        }
        $output = self::openTag('li', $htmlOptions);
        $output .= self::dropdownToggleMenuLink($label, $url, $linkOptions, $depth);
        $output .= self::menu($items, $menuOptions, $depth + 1);
        $output .= '</li>';
        return $output;
    }
protected static function menuDropdown ( $ label , $ url , $ items , $ htmlOptions , $ depth = 0 ) { self :: addCssClass ( $ depth === 0 ? 'dropdown' : 'dropdown-submenu' , $ htmlOptions ) ; TbArray :: defaultValue ( 'role' , 'menuitem' , $ htmlOptions ) ; $ linkOptions = TbArray :: popValue ( 'linkOptions' , $ htmlOptions , array ( ) ) ; $ menuOptions = TbArray :: popValue ( 'menuOptions' , $ htmlOptions , array ( ) ) ; self :: addCssClass ( 'dropdown-menu' , $ menuOptions ) ; if ( $ depth === 0 ) { $ defaultId = parent :: ID_PREFIX . parent :: $ count ++ ; TbArray :: defaultValue ( 'id' , $ defaultId , $ menuOptions ) ; $ menuOptions [ 'aria-labelledby' ] = $ menuOptions [ 'id' ] ; $ menuOptions [ 'role' ] = 'menu' ; } $ output = self :: openTag ( 'li' , $ htmlOptions ) ; $ output .= self :: dropdownToggleMenuLink ( $ label , $ url , $ linkOptions , $ depth ) ; $ output .= self :: menu ( $ items , $ menuOptions , $ depth + 1 ) ; $ output .= '</li>' ; return $ output ; }
Generates a menu dropdown.
@param string $label the link label.
@param string $url the link URL.
@param array $items the menu configuration.
@param array $htmlOptions additional HTML attributes.
@param integer $depth the current depth.
@return string the generated dropdown.
Generates a menu dropdown .