Skip to content

Commit d6a782b

Browse files
committed
updated docs for a functional include
1 parent ce2bdbf commit d6a782b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/statements.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,22 @@ begin
590590

591591
include() can also take a second parameter, allowing for improved scoping of variables, similar to the _with_ statement.
592592

593+
We have a 'functional' include syntax:
594+
```
595+
<% template 'button' %>
596+
<button text="<% text %>">
597+
<% end %>
598+
599+
<% button { text="add" } %>
600+
601+
or
602+
603+
<% button text="remove" %>
604+
```
605+
606+
Above we can see we don't need to use the explict 'include' statement.
607+
608+
593609
<a name="require"><h3>require</h3></a>
594610

595611
![require](./images/stmt_require.svg)

0 commit comments

Comments
 (0)