Previous topic

HTML辅助函数

Next topic

页面布局

This Page

装饰器

装饰器(BEAUTIFY)的作用是用来生成容器对象的HTML代码,包括列表,元祖和字典:

{{=BEAUTIFY({"a":["hello", XML("world")], "b":(1,2)})}}

装饰器(BEAUTIFY)会返回一个类似于XML的对象,将它序列化成XML,用一种美观的方式呈现出来。举个例子来说,如果存在如下的代码:

{"a":["hello", XML("world")], "b":(1,2)}

将会被渲染成:

<table>
<tr><td>a</td><td>:</td><td>hello<br/>world</td></tr>
<tr><td>b</td><td>:</td><td>1<br/>2</td></tr>
</table>