Overview

Namespaces

  • Menu
    • Items
      • Contents
    • Traits

Classes

  • Menu
  • MenuHandler
  • MenuServiceProvider
  • Overview
  • Namespace
  • Class

Class Menu

Basic interface to different components within the package

Namespace: Menu
Located at Menu/Menu.php
Methods summary
public static Menu\MenuHandler
# handler( string|array $names = '', array $attributes = array(), string $element = 'ul' )

Get a MenuHandler.

Get a MenuHandler.

This method will retrieve ItemLists by name, If an ItemList doesn't already exist, it will be registered and added to the handler.

// Get the menu handler that handles the default name
   $handler = Menu::handler();

   // Get a named menu handler for a single name
   $handler = Menu::handler('backend');

   // Get a menu handler that handles multiple names
   $handler = Menu::handler(array('admin', 'sales'));

Parameters

$names
The name this handler should respond to
$attributes
Its attributes
$element
Its element

Returns

Menu\MenuHandler
public static Menu\MenuHandler
# allHandlers( )

Get a MenuHandler for all registered ItemLists

Get a MenuHandler for all registered ItemLists

Returns

Menu\MenuHandler
public static
# reset( )

Erase all menus in memory

Erase all menus in memory

public static Menu\Items\ItemList
# items( string $name = null, array $attributes = array(), string $element = 'ul' )

Create a new ItemList

Create a new ItemList

Parameters

$name
The name of the ItemList
$attributes
The HTML attributes for the list element
$element
The HTML element for the list (ul or dd)

Returns

Menu\Items\ItemList
public static Menu\Items\ItemList
# setItemList( string $name, Menu\Items\ItemList $itemList )

Store an ItemList in memory

Store an ItemList in memory

Parameters

$name
The handle to store it to
$itemList

Returns

Menu\Items\ItemList
public static Menu\Items\ItemList
# getItemList( string $name = null )

Get an ItemList from the memory

Get an ItemList from the memory

Parameters

$name
The ItemList handle

Returns

Menu\Items\ItemList
public static mixed
# __callStatic( string $method, array $parameters = array() )

Magic Method for calling methods on the default handler.

Magic Method for calling methods on the default handler.

// Call the "render" method on the default handler
   echo Menu::render();

   // Call the "add" method on the default handler
   Menu::add('home', 'Home');

Parameters

$method
$parameters

Returns

mixed
public static Illuminate\Container\Container
# getContainer( string $dependency = null )

Get the current dependencies

Get the current dependencies

Parameters

$dependency
A dependency to make on the fly

Returns

Illuminate\Container\Container
public static
# setContainer( Illuminate\Container\Container $container )

Set the Container to use

Set the Container to use

Parameters

$container
public static mixed
# getOption( string $option = null )

Get an option from the options array

Get an option from the options array

Parameters

$option
The option key

Returns

mixed
Its value
public static
# setOption( key $option, mixed $value )

Set a global option

Set a global option

Parameters

$option
The option
$value
Its value
Properties summary
protected static Illuminate\Container\Container $container

The current IoC container

The current IoC container

#
protected static array $itemLists

All the registered names and the associated ItemLists

All the registered names and the associated ItemLists

# array()
API documentation generated by ApiGen