caffeinated / menus

:pushpin: Menu generator package for the Laravel framework
https://caffeinatedpackages.com
132 stars 59 forks source link

Active Filter #34

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi,

a little question:

How can I get only the active menu point ?

Is there a function ?

kaidesu commented 9 years ago

What do you mean?

ghost commented 9 years ago

Hi,

ok. In my application I need to know, which menu point is current active.

For example

Home ( /home) Gallery (/gallery) (active) Images (/images)

With this Information I translate dynamically the page title.

Currently I use for this information a foreach-loop and check, If the item active.

Is here a faster way ?

The perfect way for me, is addionaly to know, which main and sub menu point is active.

U knwo what i meaN ?

kaidesu commented 9 years ago

The package doesn't have this, but would be an easy addition to add. I'll add it to my list of things to do!

kaidesu commented 9 years ago

Added with ee7fed8f97d146b9cb24324541e90a0487a3ab3b.

dd(Menu::get('example')->active());

Will return an array of the menu items that are currently active.