简体   繁体   English

如何在偏航文件中包含偏航文件

[英]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. 我里面有一个偏航文件(让我说a.yaws),我有很多功能我一次又一次地使用。所以我决定将那些常见的功能放到另一个偏航文件中(让我说common.yaws)并包括偏航到偏航。 so what is the correct syntax for this. 那么正确的语法是什么 im using it but seems not including the file -include("common.yaws"). 即时通讯使用它,但似乎不包括文件-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. 如果您在公用文件中拥有的函数基本上是erlang函数,则只需将这些函数放在erlang模块中,然后直接调用该函数即可。 As an example: 举个例子:

(in one.yaws) (在一个偏航中)

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

where mycommonstuff.erl contains the exported function doIt. 其中mycommonstuff.erl包含导出的函数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: 如果您的common.yaws文件实际上包含yaws类型的功能,则可以使用服务器端的yaws包含功能-此处说明:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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