Adding a menu item

@param string $url
@param string $id
@param string $class
@param string|array $attributes
@param string $menu1
@param string $menu2
@param string $menu3
@param string $menu4
@param string $menu5
@param string $menu6
511657
public function addMenu($url, $id, $class, $attributes, $menu1, $menu2 = 'geen', $menu3 = 'geen', $menu4 = 'geen', $menu5 = 'geen', $menu6 = 'geen')
    {
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['url'] = $url;
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['id'] = $id;
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['class'] = $class;
        $this->dataMenu[$menu1][$menu2][$menu3][$menu4][$menu5][$menu6]['attrib'] = $attributes;
    }
1268457
public function add(string $menuId): void
    {
        $menu = TableRegistry::getTableLocator()->get('Menu.Menus')->get($menuId);
        $menuItem = $this->MenuItems->newEntity();
        if ($this->request->is('post')) {
            $data = $this->request->getData();
            $data['menu_id'] = $menu->id;
            $menuItem = $this->MenuItems->patchEntity($menuItem, $data);
            if ($this->MenuItems->save($menuItem)) {
                $this->Flash->success((string)__('The menu item has been saved.'));
                $this->redirect(['controller' => 'Menus', 'action' => 'view', $menu->id]);

                return;
            } else {
                $this->Flash->error((string)__('The menu item could not be saved. Please, try again.'));
            }
        }

        $parentMenuItems = $this->MenuItems
            ->find('treeList', ['spacer' => self::TREE_SPACER])
            ->where(['MenuItems.menu_id' => $menu->id]);

        $this->set(compact('menuItem', 'parentMenuItems'));
        $this->set('_serialize', ['menuItem']);
    }
934009
private void addMenuItems(Menu f, String[] m) {

        for (int i = 0; i < m.length; i++) {
            if (m[i].equals("-")) {
                f.addSeparator();
            } else {
                MenuItem item = new MenuItem(m[i]);

                item.addActionListener(this);
                f.add(item);
            }
        }
    }
682251
public function addMeasurableItem($menuName, $url, $order = 50, $tooltip = false)
    {
        $this->addItem('CoreAdminHome_MenuMeasurables', $menuName, $url, $order, $tooltip);
    }
590660
def add_menu(self, name, link=None):
        """"""
        if self.menu_began:
            if self.menu_separator_tag:
                self.write(self.menu_separator_tag)
        else:
            # First time, create the menu tag
            self.write('<ul class="horizontal">')
            self.menu_began = True

        self.write('<li>')
        if link:
            self.write('<a href="{}">', self._rel(link))

        # Write the real menu entry text
        self.write(name)

        if link:
            self.write('</a>')
        self.write('</li>')
624636
private function searchMenuLinkUsingID($list, $id)
    {
        foreach ($list as $menuLink){
            if($menuLink['menuLinkID'] == $id) {
                return $menuLink;
            }
        }
        throw new \Exception("Menu link doesn't exit, something is wrong");
    }
938251
@Override
    public MenuState<String> newMenuState(String value, boolean changed, boolean active) {
        return new StringMenuState(changed, active, value);
    }
597248
private function registerPage($title, $capabilities, $url_param, $class, $callback, $type)
    {
        if ($type == 'submenu') {
            add_submenu_page($this->url, $title, $title, $capabilities, $url_param, array(
                $class,
                $callback
            ));
        } else {
            add_menu_page($title, $title, $capabilities, $url_param, array(
                $class,
                $callback
            ));
        }
    }
954503
public function addMenu(array $menu, string $namespace = null, int $position = null): void
	{
		foreach ($menu as $name => $row) {
			if (!isset($row['link'])) {
				throw new InvalidArgumentException('First level of Menu must have set link');
			} else {
				$link = new Link($name, $row['link'], isset($row['arguments']) ? $row['arguments'] : []);
				$link->setNamespace($namespace);
				if (!empty($row['toBlank'])) {
					$link->toBlank();
				}
				$this->addItem($link, $position);
				$this->attachLink($link);

				unset($row['link'], $row['arguments'], $row['toBlank']);
				$this->addMenuItems($link, $row);
			}
		}
	}
681402
public function start_el(&$output, $item, $depth = 0, $args = [], $id = 0)
    {
        $classes = empty($item->classes) ? array() : (array) $item->classes;

        $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));
        dd($class_names);
        !empty($class_names) and $class_names = ' class="' . esc_attr($class_names) . '"';

        $output .= "<li id='menu-item-$item->ID' $class_names>";

        $attributes = '';

        !empty($item->attr_title) and $attributes .= ' title="' . esc_attr($item->attr_title) . '"';
        !empty($item->target) and $attributes .= ' target="' . esc_attr($item->target) . '"';
        !empty($item->xfn) and $attributes .= ' rel="' . esc_attr($item->xfn) . '"';
        !empty($item->url) and $attributes .= ' href="' . esc_attr($item->url) . '"';

        // insert description for top level elements only you may change this
        $description = (!empty($item->description) and 0 == $depth) ? '<small class="nav_desc">' . esc_attr($item->description) . '</small>' : '';

        $title = apply_filters('the_title', $item->title, $item->ID);

        $item_output = $args->before . "<a $attributes>" . $args->link_before . $title . '</a> ' . $args->link_after . $description .
             $args->after;

        // Since $output is called by reference we don't need to return anything.
        $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
    }
1336373
public function addTabURL($name, $url)
    {
        $item = $this->addTabMenuItem($name);
        $this->addSubView($item->name);

        $item->setPath($url);
    }
387336
protected function populateMenu($menu_id, $menu_items)
    {
        foreach ($menu_items as $menu_item) {
            if (isset($menu_item['title']) && isset($menu_item['type'])) {
                wp_update_nav_menu_item($menu_id, 0, $this->getMenuItemData($menu_item['type'], $menu_item));
            }
        }
    }
159642
public function createMenu($idNav = '', $classNav = '', $attributesNav = '', $idList = '', $classList = '', $attributesList = '')
    {
        $this->openNav($idNav, $classNav, $attributesNav);
        $this->createList('', $idList, $classList, $attributesList);
        $this->closeNav();
        return $this->output;
    }
887699
public function addHtml($menuName, $data, $displayedForCurrentUser, $order, $tooltip)
    {
        if ($displayedForCurrentUser) {
            if (!isset($this->menu[$menuName])) {
                $this->menu[$menuName]['_name'] = $menuName;
                $this->menu[$menuName]['_html'] = $data;
                $this->menu[$menuName]['_order'] = $order;
                $this->menu[$menuName]['_url'] = null;
                $this->menu[$menuName]['_icon'] = '';
                $this->menu[$menuName]['_hasSubmenu'] = false;
                $this->menu[$menuName]['_tooltip'] = $tooltip;
            }
        }
    }
783114
public function addChild($class, $id, $label, $permission, $options =[])
    {
        if (is_string($id)) {
            $id = explode('/', $id);
        }

        if (count($id) == 1) {
            if (isset($this->childItems[$id[0]])) {
                return $this->childItems[$id[0]];
            }

            $item = $this->itemBuilder->create(
                $class,
                $id[0],
                $this->getPath() . '/' . $id[0],
                $label,
                $permission,
                $options
            );
            $this->childItems[$id[0]] = $item;
            return $item;
        }

        $parent = array_splice($id, 0, count($id) - 1);
        return $this->getChild($parent)->addChild($class, $id, $label, $permission, $options);
    }
742381
public function add_element($url,$name,$active=true,$class='',$children=array()){
		$this->elements[]=(object)array(
			'url'=>$url,
			'name'=>$name,
			'active'=>$active,
			'class'=>$class,
			'children'=>$children,
			);
		}
842169
public function addPersonalItem($menuName, $url, $order = 50, $tooltip = false)
    {
        $this->addItem('UsersManager_MenuPersonal', $menuName, $url, $order, $tooltip);
    }