Nested menu

@param $title
@param $menus
12489
public function nested($title, $menus)
    {
        $nested = [
            'title' => $title,
            'type' => 'nested',
            'call_to_actions' => [],
        ];
        $this->stack[] = $nested;

        $this->loadMenus($menus);
        $this->createMenu(['call_to_actions' => [array_pop($this->stack)]]);
    }
500168
private function displayHTML($menus)
    {
        $build    = [];
        $manager  = $this->getTreeManager();

        /** @var \MakinaCorpus\Umenu\Menu $menu */
        foreach ($menus as $menu) {
            if ($menu->isSiteMain() || !$menu->hasRole()) {
                $tree = $manager->buildTree($menu->getId(), true);
                if (!$tree->isEmpty()) {
                    $build[$menu->getTitle()] = $tree;
                }
            }
        }

        return theme('ucms_seo_sitemap', ['menus' => $build]);
    }
217099
public function setTitle($title, $both = true)
    {
        $this->data['_head_title'] = strip_tags($title);

        if ($both && !isset($this->data['_page_title'])) {
            $this->setPageTitle($title);
        }
    }
1169466
public function writeHeadline( string $title, int $level ) : void
	{
		$this->write( "%s %s\n\n", str_repeat( '#', $level ), $title );
	}
930834
public function setTitle($title, $link = null)
    {
        $this->data['title'] = $title;
        if ($link) {
            $this->data['title_link'] = $link;
        }

        return $this;
    }
1134556
public function setTitle($title, $subtitle = null)
    {
        $this->title = $title;
        $this->subtitle = $subtitle;
    }
718840
public function addGroup($title)
    {
        $group = $this->add([new self(), 'defaultTemplate' => 'menugroup.html', 'ui' => false]);
        if (is_string($title)) {
            $group->set('title', $title);
        } else {
            if (isset($title['icon']) && $title['icon']) {
                $group->add(new Icon($title['icon']), 'Icon')->removeClass('item');
            }
            $group->set('title', $title[0]);
        }

        return $group;
    }
1285886
private function convertToParentChild($menuLinks)
    {
        $tmp = [];
        $count = 0;
        foreach($menuLinks as $key => $menuLink){

            // Append menuLink Routes to each menu link
            if($menuLink['routeName']) {
                $route = Route::getRoutes()->getByName($menuLink['routeName']);
                if($route) {
                    $controller = Arr::last(explode('\\', get_class($route->getController())));
                    $routes = $this->getMenuLinkRoutes($controller, $menuLink['belongsTo']);

                    // Category
                    if($menuLink['belongsTo'] == 'category') {
                        $routeName = 'backend.postType.single';
                        $menuLink['href'] = route($routeName, ['view' => 'categoryupdate', 'id' => $menuLink['belongsToID']]);
                        $menuLink['routeList'] = $routes['list'];
                    }else if($menuLink['belongsTo'] == 'post_type') {
                        // Post Types
                        $routeName = 'backend.postType.single';
                        $menuLink['href'] = route($routeName, ['view' => 'update', 'id' => $menuLink['belongsToID']]);

                        $slugArr = array_first((array)$menuLink['slug']);
                        if($slugArr) {
                            $menuLink['routeList'] = $routes[$slugArr]['list'];
                        }
                    }else{
                        // Single post
                        $routeName = 'backend.post.single';
                        $menuLink['href'] = route($routeName, ['post_type' => $menuLink['belongsTo'],'view' => 'update', 'id' => $menuLink['belongsToID']]);
                        $menuLink['routeList'] = $routes['list'];
                    }

                }
            }

            $tmp[$count] = $menuLink;
            $children = $this->getChildren($menuLink['menuLinkID']);
            if(count($children)) {
                $tmp[$count]['children'] = $this->convertToParentChild($children);
            }
            $count++;
        }
        return $tmp;
    }
1342919
public function setTitle($title)
    {
        $returnValue = (bool) false;

        
		$this->title = $title;
		$returnValue = true;
        

        return (bool) $returnValue;
    }
1367852
private static function normalizeMenu(&$assigned, &$menus, $callback, $parent = null)
    {
        $result = [];
        $order = [];
        foreach ($assigned as $id) {
            $menu = $menus[$id];
            if ($menu['parent'] == $parent) {
                $menu['children'] = static::normalizeMenu($assigned, $menus, $callback, $id);
                if ($callback !== null) {
                    $item = call_user_func($callback, $menu);
                } else {
                    $item = [
                        'label' => $menu['name'],
                        'url' => static::parseRoute($menu['route']),
                    ];
                    if ($menu['children'] != []) {
                        $item['items'] = $menu['children'];
                    }
                }
                $result[] = $item;
                $order[] = $menu['order'];
            }
        }
        if ($result != []) {
            array_multisort($order, $result);
        }

        return $result;
    }
875146
public function add(string $title, string $url)
    {
        $this->breadcrumbs->push(new Breadcrumb($title, $url));
    }
925694
private function parseMenuItems($title, string $url, array $children, array $fields): Item
    {
        $urlGenerator = $this->instantiateUrlGenerator();

        // Extract parameters into variables
        if (is_array($title)) {
            extract($title);
        }

        // If child elements provided
        if ($children) {
            $childItems = [];

            foreach ($children as $child) {
                $this->checkFormat($child);

                // If child contains child elements, use recursively add them
                if (isset($child['children']) && $child['children']) {
                    $childItems[] = $this->parseMenuItems($child['title'], $child['url'], $child['children'],
                        $child['fields'] ?? []);
                } else {
                    $childItems[] = new Item($child['title'], $child['url'], [], $child['fields'] ?? [], new Config, $urlGenerator);
                }
            }
        }

        return new Item($title, $url, $childItems ?? $children, $fields, new Config, $urlGenerator);
    }
818943
public function setTitle($title, $siteName = null, $separator = null)
    {
        return $this->seo()->setTitle($title, $siteName, $separator);
    }
175543
public function setTitle(Title $title)
    {
        $this->attachment['title'] = $title;

        if ($title->hasLink()) {
            $this->attachment['title_link'] = $title->getLink();
        }

        return $this;
    }
690312
protected static function createMenu($title, $uri, $icon = 'fa-bars', $parentId = 0)
    {
        $menuModel = config('admin.database.menu_model');

        $lastOrder = $menuModel::max('order');

        $menuModel::create([
            'parent_id' => $parentId,
            'order'     => $lastOrder + 1,
            'title'     => $title,
            'icon'      => $icon,
            'uri'       => $uri,
        ]);
    }
1169226
public function title($title = null)
    {
        if (is_null($title)) {
            return $this->title;
        }

        $this->title = $title;

        return $this;
    }
644230
public function setTitleLocArgs(array $titleLocArgs): self
    {
        foreach ($titleLocArgs as &$titleLocArg) {
            $titleLocArg = (string) $titleLocArg;
        }
        unset($titleLocArg);
        $this->titleLocArgs = $titleLocArgs;

        return $this;
    }