-
Notifications
You must be signed in to change notification settings - Fork 59
Active Link Detection
Caffeinated Menus will actually automatically detect the currently active link for you, based on the current URL. Once an item is detected as being the active link, a new active
class will be attributed to the item. So you will only need to be sure to echo out the item's attributes from within your view (see the documentation on rendering attributes for more information).
The automatic link detection is only useful for one-on-one URI detection. It does not take into consideration of any dynamic URI segments, such as blog/post/edit/1
. For these cases, you may specify that the active state should be activated against other URI segments.
$menu->add('Blog', '#')->active('admin/blog/*');
The above menu item will be active on any URI that matches admin/blog/*
:
admin/blog
admin/blog/create
admin/blog/edit/1
- etc.
🔴 Best Temporary Email - https://1secmail.ru 🔴