Skip to content

严重程度标签

用法

用于渲染禅道严重程度标签。

指定值和文本

php
severityLabel(1, '严重'); // 等同于 severityLabel(set::level(1), set::text('严重'));
severityLabel(2, '较严重');
severityLabel(3, '3');
severityLabel(4, '4');
severityLabel(0, '未知');
html
<span class="severity severity-label" data-severity="1">严重</span>
<span class="severity severity-label" data-severity="2">较严重</span>
<span class="severity" data-severity="3"></span>
<span class="severity" data-severity="4"></span>
<span class="severity severity-label" data-severity="0">未知</span>

指定值和文本映射对象

php
$severityList = array();
$severityList[1] = '严重';
$severityList[2] = '较严重';
$severityList[3] = '3';
$severityList[4] = '4';
$severityList[0] = '未知';

severityLabel(1, set::text($severityList));
severityLabel(2, set::text($severityList));
severityLabel(3, set::text($severityList));
severityLabel(4, set::text($severityList));
severityLabel(0, set::text($severityList));
html
<span class="severity severity-label" data-severity="1">严重</span>
<span class="severity severity-label" data-severity="2">较严重</span>
<span class="severity" data-severity="3"></span>
<span class="severity" data-severity="4"></span>
<span class="severity severity-label" data-severity="0">未知</span>

仅指定严重程度的值

php
severityLabel(1);
severityLabel(2);
severityLabel(3);
severityLabel(4);
severityLabel(0);
html
<span class="severity" data-severity="1"></span>
<span class="severity" data-severity="2"></span>
<span class="severity" data-severity="3"></span>
<span class="severity" data-severity="4"></span>
<span class="severity" data-severity="0"></span>

属性

名称 类型 可选 默认值 说明
levelstringint严重程度等级。
textstringarraynull标签文本或标签文本映射对象。
isIconboolfalse是否显示为图标。

https://zentao.net