简体   繁体   中英

how to include yaws file inside the yaws file

i have one yaws file(let say a.yaws) inside that I have a lot of function which im using again and again .so i have decided to put those common function inside the other yaws file (let say common.yaws) and include this yaws to a.yaws. so what is the correct syntax for this. im using it but seems not including the file -include("common.yaws").

thanx in adavance.

If the functions you have in your common file are basically erlang functions you can simply put those functions in an erlang module and simply call the function directly. As an example:

(in one.yaws)

<erl>
   out(Arg) ->
    mycommonstuff:doIt(Arg).
</erl>

where mycommonstuff.erl contains the exported function doIt.

If your common.yaws file actually contains yaws type features you could use the server side include feature of yaws - that is explained here:

http://yaws.hyber.org/ssi.yaws

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM