-
Notifications
You must be signed in to change notification settings - Fork 233
Meta Data
Shea Lewis edited this page Nov 16, 2015
·
1 revision
The package 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(array(
'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"
...
- Active Link Detection
- Append and Prepend
- Attributes
- Dividers
- [Meta Data](Meta Data)
- [Sort By](Sort By)