导航列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\WebNavModel::navList |
| 所属业务 | 站点内容 |
| 来源模块/系统 | 模板控制器 |
功能说明
导航列表
调用示例
$param = ['theme' => 'string', 'language' => 'zh-cn'];
$result = (new \app\common\model\WebNavModel())->navList($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.theme | string | 否 | — | — | 主题标识,不传递时默认为当前系统设置的主题 |
param.language | string | 否 | — | — | 语言zh-cn,en-us |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 一级导航 |
list[].id | int | 一级导航ID |
list[].name | string | 名称 |
list[].file_address | string | 文件地址 |
list[].show | int | 是否展示 |
list[].blank | int | 是否打开新窗口 |
list[].children | array | 二级导航 |
list[].children[].id | int | 二级导航ID |
list[].children[].parent_id | int | 父导航ID |
list[].children[].name | string | 名称 |
list[].children[].description | string | 描述 |
list[].children[].file_address | string | 文件地址 |
list[].children[].icon | string | 图标 |
list[].children[].show | int | 是否展示 |
list[].children[].blank | int | 是否打开新窗口 |
正常返回
{
"list": [
{
"id": 1,
"name": "示例名称",
"file_address": "string",
"show": 1,
"blank": 1,
"children": [
{
"id": 1,
"parent_id": 1,
"name": "示例名称",
"description": "192.0.2.1",
"file_address": "string",
"icon": "string",
"show": 1,
"blank": 1
}
]
}
]
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |