private function createSubmenu(array $arguments, array $subMenu): string
    {
        $argsCount = count($arguments);
        $arrayKey = $this->getArrayKey($subMenu);
        list($url, $text, $place, $id, $class) = $this->getLinkInformation($arguments);
        $output = '<a class="nav-link dropdown-toggle';
        $output = !empty($class) ? $output . ' ' . $class . '"' : $output . '"';
        if (!empty($id)) $output .= ' id="' . $id . '"';
        $output .= ' href="#" id="dropdown' . ++$this->numberSubmenu . '" role="button"';
        $output .= ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">';
        $output .= $text . '</a>';
        $output .= '<ul class="dropdown-menu" aria-labelledby="dropdown' . $this->numberSubmenu . '">';
        if ($this->options['overview']) $output .= $this->overviewUrl($url, $id, $class);
        foreach ($arrayKey as $menuItem) {
            $arguments[$argsCount] = $menuItem;
            $arraySubKey = $this->getArrayKey($subMenu[$menuItem]);
            if (count($arraySubKey) === 0) {
                $output .= '<li>';
                $output .= $this->createDropDownItemUrl($arguments);
                $output .= '</li>';
            } else {
                $output .= '<li>';
                $output .= $this->createDropDownItemSubUrl($arguments);
                $output .= $this->createSubSubmenu($arguments, $subMenu[$menuItem]);
                $output .= '</li>';
            }
        }
        $output .= '</ul>';
        return $output;
    }
private function createSubmenu(array $arguments, array $subMenu): string
    {
        $argsCount = count($arguments);
        $arrayKey = $this->getArrayKey($subMenu);
        list($url, $text, $place, $id, $class) = $this->getLinkInformation($arguments);
        $output = '<a class="nav-link dropdown-toggle';
        $output = !empty($class) ? $output . ' ' . $class . '"' : $output . '"';
        if (!empty($id)) $output .= ' id="' . $id . '"';
        $output .= ' href="#" id="dropdown' . ++$this->numberSubmenu . '" role="button"';
        $output .= ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">';
        $output .= $text . '</a>';
        $output .= '<ul class="dropdown-menu" aria-labelledby="dropdown' . $this->numberSubmenu . '">';
        if ($this->options['overview']) $output .= $this->overviewUrl($url, $id, $class);
        foreach ($arrayKey as $menuItem) {
            $arguments[$argsCount] = $menuItem;
            $arraySubKey = $this->getArrayKey($subMenu[$menuItem]);
            if (count($arraySubKey) === 0) {
                $output .= '<li>';
                $output .= $this->createDropDownItemUrl($arguments);
                $output .= '</li>';
            } else {
                $output .= '<li>';
                $output .= $this->createDropDownItemSubUrl($arguments);
                $output .= $this->createSubSubmenu($arguments, $subMenu[$menuItem]);
                $output .= '</li>';
            }
        }
        $output .= '</ul>';
        return $output;
    }
private function createSubmenu ( array $ arguments , array $ subMenu ) : string { $ argsCount = count ( $ arguments ) ; $ arrayKey = $ this -> getArrayKey ( $ subMenu ) ; list ( $ url , $ text , $ place , $ id , $ class ) = $ this -> getLinkInformation ( $ arguments ) ; $ output = '<a class="nav-link dropdown-toggle' ; $ output = ! empty ( $ class ) ? $ output . ' ' . $ class . '"' : $ output . '"' ; if ( ! empty ( $ id ) ) $ output .= ' id="' . $ id . '"' ; $ output .= ' href="#" id="dropdown' . ++ $ this -> numberSubmenu . '" role="button"' ; $ output .= ' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' ; $ output .= $ text . '</a>' ; $ output .= '<ul class="dropdown-menu" aria-labelledby="dropdown' . $ this -> numberSubmenu . '">' ; if ( $ this -> options [ 'overview' ] ) $ output .= $ this -> overviewUrl ( $ url , $ id , $ class ) ; foreach ( $ arrayKey as $ menuItem ) { $ arguments [ $ argsCount ] = $ menuItem ; $ arraySubKey = $ this -> getArrayKey ( $ subMenu [ $ menuItem ] ) ; if ( count ( $ arraySubKey ) === 0 ) { $ output .= '<li>' ; $ output .= $ this -> createDropDownItemUrl ( $ arguments ) ; $ output .= '</li>' ; } else { $ output .= '<li>' ; $ output .= $ this -> createDropDownItemSubUrl ( $ arguments ) ; $ output .= $ this -> createSubSubmenu ( $ arguments , $ subMenu [ $ menuItem ] ) ; $ output .= '</li>' ; } } $ output .= '</ul>' ; return $ output ; }
4.0 Create the drop down submenu

@param array $arguments
@param array $subMenu
@return string
4 . 0 Create the drop down submenu