fenom/docs/tags/macro.md

18 lines
260 B
Markdown
Raw Normal View History

2013-02-21 22:47:24 +04:00
Tag {macro}
============
2013-02-23 13:29:20 +04:00
Declare macro
2013-02-21 22:47:24 +04:00
```smarty
2013-02-23 13:29:20 +04:00
{macro plus(x, y, z=0)}
x + y + z = {$x + $y + $z}
2013-02-21 22:47:24 +04:00
{/macro}
```
2013-02-23 13:29:20 +04:00
Invoke macro
2013-02-21 22:47:24 +04:00
```smarty
2013-02-23 13:29:20 +04:00
{macro.plus x=$num y=100}
2013-02-21 22:47:24 +04:00
```
2013-02-23 13:29:20 +04:00
Use tag [{import}](./import.md) for importing existing macroses into another template