在ThinkPHP中有如下数组:
$fileList = array
(
D:\AppServ\www\weberp\trunk\source\db\update\18_12_06.sql => 18_12_06.sql,
D:\AppServ\www\weberp\trunk\source\db\update\18_12_10.sql => 18_12_10.sql,
D:\AppServ\www\weberp\trunk\source\db\update\sp\SP_IMPLEMENT_CLEAN.sql => SP_IMPLEMENT_CLEAN.sql
)
在页面中使用volist遍历显示上边数组的内容
<volist name="fileList" id="file">
<option value="{$Think.lang.$key}">{$file}</option>
</volist>
结果显示的key中把英文转为了大写
后来尝试使用foreach成功原样输出,代码如下:
<foreach name="fileList" item="file" key="num">
<option value="{$num}"> {$file} </option>
</foreach>
后来,又尝试使用volist,不用ThinkPHP的{$Think.lang.$key},直接使用{$key},也成功原样输出,代码如下:
<volist name="fileList" id="file">
<option value="{$key}"> {$file} </option>
</volist>