Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Knp Menu Laravel Package

knplabs/knp-menu

View on GitHub
Deep Wiki
Context7

How to apply the active class to an item and all ancestors

By default, the active menu item is applied with a current class and its ancestors are applied with a current_ancestor class. To apply a class other than the default or apply the same class to both, you can either pass it as an option to the render method of your used renderer:

<?php
$renderer->render($item, ['currentClass' => 'active', 'ancestorClass' => 'active']);

or pass it as argument to the constructor of the used renderer:

<?php
$renderer = new Renderer($matcher, ['currentClass' => 'active', 'ancestorClass' => 'active']);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin