PHP Class Elgg\Menu\Menu

This also encapsulates parameters to be passed to views.
Show file Open project: elgg/elgg

Public Methods

Method Description
__construct ( array $params ) Constructor
getName ( ) : string Get the menu's name
getParams ( ) : array Get the menu parameters
getSection ( string $name, mixed $default = null ) : ElggMenuIte\ElggMenuItem[] | null Get a single menu section
getSections ( ) : ElggMenuIte\ElggMenuItem[][] Get all menu sections

Method Details

__construct() public method

Constructor
public __construct ( array $params )
$params array Params. Must include: "name" menu name "menu" array of sections (each an array of items)

getName() public method

Get the menu's name
public getName ( ) : string
return string

getParams() public method

Get the menu parameters
public getParams ( ) : array
return array

getSection() public method

Get a single menu section
public getSection ( string $name, mixed $default = null ) : ElggMenuIte\ElggMenuItem[] | null
$name string Section name
$default mixed Value to return if section is not found
return ElggMenuIte\ElggMenuItem[] | null

getSections() public method

Get all menu sections
public getSections ( ) : ElggMenuIte\ElggMenuItem[][]
return ElggMenuIte\ElggMenuItem[][]