Elgg  Version 2.3
Menu.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Menu;
3 
4 use ElggMenuItem;
5 
11 class Menu {
12 
16  private $params;
17 
27  public function __construct(array $params) {
28  $this->params = $params;
29  }
30 
36  public function getSections() {
37  return $this->params['menu'];
38  }
39 
48  public function getSection($name, $default = null) {
49  return isset($this->params['menu'][$name]) ? $this->params['menu'][$name] : $default;
50  }
51 
57  public function getName() {
58  return $this->params['name'];
59  }
60 
66  public function getParams() {
67  return $this->params;
68  }
69 }
$params
Definition: login.php:72
if($guid==elgg_get_logged_in_user_guid()) $name
Definition: delete.php:21
A complete menu, sorted, filtered by the "prepare" hook, and split into sections.
Definition: Menu.php:11
getParams()
Get the menu parameters.
Definition: Menu.php:66
getSections()
Get all menu sections.
Definition: Menu.php:36
__construct(array $params)
Constructor.
Definition: Menu.php:27
getSection($name, $default=null)
Get a single menu section.
Definition: Menu.php:48
getName()
Get the menu's name.
Definition: Menu.php:57
$default
Definition: checkbox.php:34