PHP Class Elgg\Menu\UnpreparedMenu

This also encapsulates parameters to be passed to hooks and views.
Show file Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
__construct ( array $params, array $items ) Constructor
getItems ( ) : ElggMenuIte\ElggMenuItem[] Get the menu items
getName ( ) : string Get the menu name
getParams ( ) : array Get the menu parameters
getSortBy ( ) : string | callable Get the designated (or default) sort strategy
setSortBy ( string | callable $sort_by = 'text' ) : void Set how this menu should be sorted

Method Details

__construct() public method

Constructor
public __construct ( array $params, array $items )
$params array Parameters to be passed to the "prepare" hook and views. Must include value for "name".
$items array Menu items

getItems() public method

Get the menu items
public getItems ( ) : ElggMenuIte\ElggMenuItem[]
return ElggMenuIte\ElggMenuItem[]

getName() public method

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

getParams() public method

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

getSortBy() public method

Get the designated (or default) sort strategy
See also: setSortBy
See also: ElggMenuBuilder::sort
public getSortBy ( ) : string | callable
return string | callable

setSortBy() public method

Set how this menu should be sorted
See also: ElggMenuBuilder::sort
public setSortBy ( string | callable $sort_by = 'text' ) : void
$sort_by string | callable Sort strategy "text", "name", "priority", or callback
return void