Elgg  Version 6.1
Menu.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Menu;
4 
10 class Menu {
11 
19  public function __construct(protected array $params) {
20  }
21 
27  public function getSections() {
28  return $this->params['menu'];
29  }
30 
39  public function getSection($name, $default = null) {
40  return $this->params['menu'][$name] ?? $default;
41  }
42 
48  public function getName() {
49  return $this->params['name'];
50  }
51 
57  public function getParams() {
58  return $this->params;
59  }
60 }
$default
Definition: checkbox.php:30
$params
Saves global plugin settings.
Definition: save.php:13
getParams()
Get the menu parameters.
Definition: Menu.php:57
getName()
Get the menu&#39;s name.
Definition: Menu.php:48
getSection($name, $default=null)
Get a single menu section.
Definition: Menu.php:39
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
__construct(protected array $params)
Constructor.
Definition: Menu.php:19
getSections()
Get all menu sections.
Definition: Menu.php:27
A complete menu, sorted, filtered by the "prepare" event, and split into sections.
Definition: Menu.php:10