forked from modstart/ModStartBlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMemberNavMenu.php
More file actions
45 lines (36 loc) · 827 Bytes
/
Copy pathMemberNavMenu.php
File metadata and controls
45 lines (36 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace Module\Member\Config;
use Illuminate\Support\Str;
use ModStart\Core\Util\RenderUtil;
/**
* 右上角菜单
*/
class MemberNavMenu
{
private static $menu = [];
public static function register($menu)
{
self::$menu[] = $menu;
}
public static function get()
{
$menu = [];
foreach (self::$menu as $item) {
if ($item instanceof \Closure) {
$item = call_user_func($item);
}
$menu = array_merge($menu, $item);
}
return $menu;
}
public static function render()
{
$items = self::get();
if (empty($items)) {
return '';
}
return RenderUtil::view('module::Member.View.inc.memberNavMenu', [
'items' => $items,
]);
}
}