获取前台导航
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 函数 |
| 方法标识 | /console/v1/menu |
| 所属业务 | 站点内容 |
| 来源模块/系统 | 导航管理模型 |
功能说明
获取前台导航
调用示例
$result = (new \app\common\model\MenuModel())->homeMenu();参数
该函数/方法无需传入参数。
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
menu | array | 菜单 |
menu[].id | int | 菜单ID |
menu[].name | string | 名称 |
menu[].url | string | 网址 |
menu[].menu_type | string | 菜单类型system系统plugin插件custom自定义module模块res_module上游模块embedded内嵌 |
menu[].second_reminder | int | 二次提醒0否1是 |
menu[].icon | string | 图标 |
menu[].parent_id | int | 父ID |
menu[].child | array | 子菜单 |
menu[].child[].id | int | 菜单ID |
menu[].child[].name | string | 名称 |
menu[].child[].url | string | 网址 |
menu[].child[].second_reminder | int | 二次提醒0否1是 |
menu[].child[].icon | string | 图标 |
menu[].child[].parent_id | int | 父ID |
正常返回
{
"menu": [
{
"id": 1,
"name": "示例名称",
"url": "https://example.com/callback",
"menu_type": "string",
"second_reminder": 1,
"icon": "string",
"parent_id": 1,
"child": [
{
"id": 1,
"name": "示例名称",
"url": "https://example.com/callback",
"second_reminder": 1,
"icon": "string",
"parent_id": 1
}
]
}
]
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |