关于webmachie源码中-module({{appid}}_resource)的疑惑

3 views
Skip to first unread message

郎咸武

unread,
Nov 2, 2011, 8:27:30 AM11/2/11
to ec...@googlegroups.com, erlang-china
hi 同学们
我有以下问题 麻烦帮忙看一下
 5 -module({{appid}}_resource).
  6 -export([init/1, to_html/2]).
  7 
  8 -include_lib("webmachine/include/webmachine.hrl").
  9 
 10 init([]) -> {ok, undefined}.
 11 
 12 to_html(ReqData, State) ->
 13     {"<html><body>Hello, new world</body></html>", ReqData, State}.
~                                                                          
以上代码片段是 webmachie vmskel_resource.erl里面的 
对 5 -module({{appid}}_resource).
用法不是很理解,请问 这是什么用法。从源码结构中能猜出是模板。求解



网易公开课推出哈佛最受欢迎《幸福》课程,帮您修满幸福学分!
Reply all
Reply to author
Forward
0 new messages