mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
27 lines
557 B
Plaintext
27 lines
557 B
Plaintext
{%
|
|
function test(name) {
|
|
context.write("Hello " + name + "!");
|
|
}
|
|
%}
|
|
{%
|
|
function test2(name) {
|
|
return "Hello " + name + "!";
|
|
}
|
|
%}
|
|
|
|
A
|
|
|
|
<p>
|
|
<c-invoke function="test('World')"/>
|
|
<c-write value="test2('World')"/>
|
|
</p>
|
|
|
|
B
|
|
|
|
<p>
|
|
<c-def function="greeting(name, count)">
|
|
Hello ${name}! You have ${count} new messages.
|
|
</c-def>
|
|
<c-invoke function="greeting" name="Frank" count="${10}"/>
|
|
<c-invoke function="greeting('John', 20)"/>
|
|
</p> |