-
Notifications
You must be signed in to change notification settings - Fork 59
Meta Data
niknetniko edited this page Mar 5, 2016
·
5 revisions
Caffeinated Menus provides the means to add any number of additional meta data to your menu items. It can be anything from item order placement information to permissions required to view or access the item's link, to anything else you can think of or need. This is achievable by utilizing the data()
method against your menu item.
...
$menu->add('Dashboard', 'admin')
->data('order' => 0);
...
You have a couple ways to assigning meta data to your menu items; key-value pairing as shown in the example above, or through an associative array:
...
$menu->add('Dashboard', 'admin')
->data([
'order' => 0,
'permission' => 'view_admin_dashboard',
'lorem' => 'ipsum'
]);
...
Once meta data has been assigned, you may also retrieve the information back:
...
echo $menu->dashboard->order; // Will echo 0
echo $menu->dashboard->permission; // Will echo "view_admin_dashboard"
echo $menu->dashboard->lorem; // Will echo "ipsum"
...
🔴 Best Temporary Email - https://1secmail.ru 🔴