我想用 n2o 和 rebar3 写网页。但我的页面有问题,代码在这里。
索引.erl
-module(index).
-compile(export_all).
-include_lib("n2o/include/wf.hrl").
-include_lib("nitro/include/nitro.hrl").
main() -> #dtl{file="prod",app=web, ext="dtl", bindings=[{body,body()} ]}.
body() ->
[ #span { id=display }, #br{},
#span { body="Login: " }, #textbox{id=user,autofocus=true}, #br{},
#span { body="Join/Create Feed: " }, #textbox{id=pass},
#button { id=loginButton, body="Login",postback=login,source=[user,pass]} ].
产品.dtl
<html >
<head>
<title>{{title}}</title>
</head>
<body>
{{body}}
</body>
</html>
我得到结果:
<html >
<head>
<title></title>
</head>
<body>
<span id="display"></span><br/><span>Login: </span><input id="user" type="text" autofocus="true"/><br/><span>Join/Create Feed: </span><input id="pass" type="text"/><button id="loginButton" type="button">Login</button>
</body>
</html>
我怎样才能得到'<'而不是'<'