We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I've looked through the docs and seen how to add classes to the ul and the a but not the li.
Bootstrap has nav-item on the li and I can't seem to work out how to add that within the ->route() items.
->route()
Menu::macro('main', function() { $menu = Menu::new() ->addClass('navbar-nav mr-auto') ->addItemClass('nav-link') ->route('candidates.index', 'Candidates') ->route('requisitions.index', 'Requisitions') ->route('accounts.index', 'Accounts') ->route('contacts.index', 'Contacts') ->setActiveFromRequest() ; return $menu; });
Which generates
<ul class="navbar-nav mr-auto"> <li> <a href="https://domain.dev/candidates" class="nav-link">Candidates</a> </li> <li class="active"> <a href="https://domain.dev/requisitions" class="nav-link">Requisitions</a> </li> <li> <a href="https://domain.dev/accounts" class="nav-link">Accounts</a> </li> <li> <a href="https://domain.dev/contacts" class="nav-link">Contacts</a> </li> </ul>
but I need this on each item
<li class="nav-item">
Thanks!
The text was updated successfully, but these errors were encountered:
There's also an addItemParentClass method, which should add the class on the li tag instead of the link.
addItemParentClass
li
Sorry, something went wrong.
Ah yes, worked! I searched for "parent" and that didn't show up :( should of searched parent class.
No branches or pull requests
Hi,
I've looked through the docs and seen how to add classes to the ul and the a but not the li.
Bootstrap has nav-item on the li and I can't seem to work out how to add that within the
->route()
items.Which generates
but I need this on each item
Thanks!
The text was updated successfully, but these errors were encountered: