fenom/docs/tags/extends.md

56 lines
690 B
Markdown
Raw Normal View History

2013-02-15 12:17:23 +04:00
Tag {extends}
=============
2013-02-19 09:51:33 +04:00
Тег {extends} реализует наследование шаблонов
2013-02-15 12:17:23 +04:00
### {extends}
2013-02-19 09:51:33 +04:00
```smarty
{extends 'parent.tpl'}
```
```smarty
{extends $parent_tpl}
```
2013-02-15 12:17:23 +04:00
### {block}
2013-02-19 09:51:33 +04:00
```smarty
{block bk1}content 1{/block}
{block 'bk2'}content 2{/block}
{block "bk{$number}"}content {$number}{/block}
{if $condition}
{block "bk-if"}content, then 'if' is true{/block}
{else}
{block "bk{$fail}"}content, then 'if' is false{/block}
{/if}
```
2013-02-15 12:17:23 +04:00
### {use}
2013-02-19 09:51:33 +04:00
```smarty
{use 'blocks.tpl'}
{if $theme.extended?}
{use $theme.extended}
{/if}
```
2013-02-15 12:17:23 +04:00
### {parent}
2013-02-19 09:51:33 +04:00
```smarty
{block 'block1'}
content ...
{parent}
content ...
{/block}
```
2013-02-15 12:17:23 +04:00
2013-02-19 09:51:33 +04:00
### Perfomance
2013-02-15 12:17:23 +04:00