1 | <?php |
||
13 | class Manager |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $menus = [ ]; |
||
20 | |||
21 | |||
22 | /** |
||
23 | * Initialise a new menu. |
||
24 | * |
||
25 | * This will attach the menu to the array of menus, |
||
26 | * which can later be retrieved for adding items. |
||
27 | * |
||
28 | * @param string $name |
||
29 | * |
||
30 | * @return mixed |
||
31 | */ |
||
32 | public function init($name) |
||
40 | |||
41 | |||
42 | /** |
||
43 | * Return a new menu item with the given label. |
||
44 | * |
||
45 | * @param string $label |
||
46 | * @param array $options |
||
47 | * |
||
48 | * @return \Iatstuti\SimpleMenu\Menu |
||
49 | */ |
||
50 | public function create($label, array $options = [ ]) |
||
54 | |||
55 | |||
56 | /** |
||
57 | * Return the menu for the given name, if available. |
||
58 | * |
||
59 | * @param string $name |
||
60 | * |
||
61 | * @return \Iatstuti\SimpleMenu\Menu|null |
||
62 | */ |
||
63 | public function getMenu($name) |
||
67 | } |
||
68 |