Skip to content
Shea Lewis edited this page Nov 16, 2015 · 1 revision

Assigning Meta Data

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'
    ));

...

Retrieving Meta Data

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"

...
Table of Contents
  1. Home
  2. Installation
  3. Quick Start

Getting Started

Usage
Clone this wiki locally