Elgg  Version 5.1
Menu.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Menu;
4 
10 class Menu {
11 
15  private $params;
16 
24  public function __construct(array $params) {
25  $this->params = $params;
26  }
27 
33  public function getSections() {
34  return $this->params['menu'];
35  }
36 
45  public function getSection($name, $default = null) {
46  return $this->params['menu'][$name] ?? $default;
47  }
48 
54  public function getName() {
55  return $this->params['name'];
56  }
57 
63  public function getParams() {
64  return $this->params;
65  }
66 }
$default
Definition: checkbox.php:30
getParams()
Get the menu parameters.
Definition: Menu.php:63
getName()
Get the menu&#39;s name.
Definition: Menu.php:54
getSection($name, $default=null)
Get a single menu section.
Definition: Menu.php:45
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
__construct(array $params)
Constructor.
Definition: Menu.php:24
getSections()
Get all menu sections.
Definition: Menu.php:33
A complete menu, sorted, filtered by the "prepare" event, and split into sections.
Definition: Menu.php:10