您的位置:首页 > 其它

关于yaws的一些默认规则

2011-05-21 10:24 155 查看
(本来不用说,就是erlang编程的规则,但是记录下(又不花钱……))

如果参数为空,不要省略,请用[]代替

但是是list的都要使用[]括起来

注意的 ,和.

例如

<erl>
out(Arg)->
{ehtml,
{table, [{bgcolor, "tan"}],%%如果不设置背景,[{bgcolor, "tan"}]可以省略为[]
[{tr, [],%%参数省略
[{td, [{width, "70%"}], {p, [{class, "foo"}], "Hi there"}},%%如果只有一行,则可以不适用中括号
{td,[],{p,[],"wojiaosonglu"}}]
},{tr, [],
[{td, [{width, "70%"}], {p, [{class, "foo"}], "Hi there"}},
{td,[],{p,[],"wojiaosonglu"}}]
}]
}
}.
</erl>

table只有一行

<erl>
out(Arg)->
{ehtml,
{table, [{bgcolor, "tan"}],
{tr, [],%%没有中括号
[{td, [{width, "70%"}], {p, [{class, "foo"}], "Hi there"}},
{td,[],{p,[],"wojiaosonglu"}
}
}.
</erl>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: