Non-list Menus

As of v2.5, you can render menus without ul and li tags. This can be achieved with the setWrapperTag, withoutWrapperTag, setParentTag and withoutParentTag methods.

Without wrapper tag & without parent tag:

Menu::new()
    ->withoutWrapperTag()
    ->withoutParentTag()
    ->link('/', 'Home')
    ->link('/about', 'About');
<a href="/">Home</a>
<a href="/about">About</a>

Without wrapper tag & with custom parent tag:

Menu::new()
    ->withoutWrapperTag()
    ->setParentTag('span')
    ->link('/', 'Home')
    ->link('/about', 'About');
<span><a href="/">Home</a></span>
<span><a href="/about">About</a></span>

With custom wrapper tag & without parent tags:

Menu::new()
    ->setWrapperTag('nav')
    ->withoutParentTag()
    ->link('/', 'Home');
    ->link('/about', 'About');
<nav>
    <a href="/">Home</a>
    <a href="/about">About</a>
</nav>

With custom wrapper tag & custom parent tags:

Menu::new()
    ->setWrapperTag('nav')
    ->setParentTag('span')
    ->link('/', 'Home');
    ->link('/about', 'About');
<nav>
    <span><a href="/">Home</a></span>
    <span><a href="/about">About</a></span>
</nav>