Elgg
Version 2.3
|
Methods to construct and prepare menus for rendering. More...
Public Member Functions | |
__construct (PluginHooksService $hooks, Config $config) | |
Constructor. More... | |
getMenu ($name, array $params=[]) | |
Build a full menu, pulling items from configuration and the "register" menu hooks. More... | |
getUnpreparedMenu ($name, array $params=[]) | |
Build an unprepared menu. More... | |
prepareMenu (UnpreparedMenu $menu) | |
Split a menu into sections, and pass it through the "prepare" hook. More... | |
combineMenus (array $names=[], array $params=[], $new_name= '') | |
Combine several menus into one. More... | |
prepareMenuItems (array $items=[]) | |
Prepare menu items. More... | |
Methods to construct and prepare menus for rendering.
Definition at line 12 of file Service.php.
Elgg\Menu\Service::__construct | ( | PluginHooksService | $hooks, |
Config | $config | ||
) |
Constructor.
PluginHooksService | $hooks | Plugin hooks |
Config | $config | Elgg config private |
Definition at line 32 of file Service.php.
Elgg\Menu\Service::combineMenus | ( | array | $names = [] , |
array | $params = [] , |
||
$new_name = '' |
|||
) |
Combine several menus into one.
Unprepared menus will be built separately, then combined, with items reassigned to sections named after their origin menu. The returned menu must be prepared before display.
string[] | $names Menu names | |
array | $params | Menu params |
string | $new_name | Combined menu name (used for the prepare hook) |
Definition at line 116 of file Service.php.
Elgg\Menu\Service::getMenu | ( | $name, | |
array | $params = [] |
||
) |
Build a full menu, pulling items from configuration and the "register" menu hooks.
Parameters are filtered by the "parameters" hook.
string | $name | Menu name |
array | $params | Hook/view parameters |
Definition at line 47 of file Service.php.
Elgg\Menu\Service::getUnpreparedMenu | ( | $name, | |
array | $params = [] |
||
) |
Build an unprepared menu.
string | $name | Menu name |
array | $params | Hook/view parameters |
Definition at line 59 of file Service.php.
Elgg\Menu\Service::prepareMenu | ( | UnpreparedMenu | $menu | ) |
Split a menu into sections, and pass it through the "prepare" hook.
UnpreparedMenu | $menu | Menu |
Definition at line 90 of file Service.php.
Elgg\Menu\Service::prepareMenuItems | ( | array | $items = [] | ) |
Prepare menu items.
array | $items | An array of ElggMenuItem instances or menu item factory options |
Definition at line 146 of file Service.php.