mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Translate tags's documentation
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
Tag {autoescape}
|
Тег {autoescape}
|
||||||
=====================
|
================
|
||||||
|
|
||||||
Force enable or disable `auto_escape` option for block area:
|
Задает индивидуальное значение параметра `auto_escape` на фрагмент шаблона:
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{autoescape true}
|
{autoescape true}
|
||||||
...
|
...
|
||||||
Text: {$text} {* value of the variable $text will be escaped *}
|
Text: {$text} {* значение переменной $text будет заэкранированно *}
|
||||||
...
|
...
|
||||||
{/autoescape}
|
{/autoescape}
|
||||||
```
|
```
|
||||||
|
|
||||||
Also see {raw} tag and :raw tag option
|
Так же смотите тег [{raw}](./raw.md) и параметр тега [:raw](../configuration.md)
|
||||||
|
@@ -1,14 +1,12 @@
|
|||||||
Tag {autotrim}
|
Тег {autotrim}
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Force enable or disable `auto_trim` option for block area:
|
Задает индивидуальное значение параметра `auto_trim` на фрагмент шаблона:
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{autotrim true}
|
{autotrim true}
|
||||||
...
|
...
|
||||||
Text: {$text} {* value of the variable $text will be escaped *}
|
Text: {$text}
|
||||||
...
|
...
|
||||||
{/autotrim}
|
{/autotrim}
|
||||||
```
|
```
|
||||||
|
|
||||||
Also see :trim, :rtrim and :ltrim tag options
|
|
@@ -5,12 +5,12 @@
|
|||||||
С его помощью можно легко реализовать чередование двух или более заданных значений.
|
С его помощью можно легко реализовать чередование двух или более заданных значений.
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{for $i=$a.c..}
|
{for $i=1 to=6}
|
||||||
<div class="{cycle ["odd", "even"]}">
|
<div class="{cycle ["odd", "even"]}">
|
||||||
{/for}
|
{/for}
|
||||||
|
|
||||||
|
|
||||||
{for $i=$a.c..}
|
{for $i=1 to=6}
|
||||||
<div class="{cycle ["odd", "even"] index=$i}">
|
<div class="{cycle ["odd", "even"] index=$i}">
|
||||||
{/for}
|
{/for}
|
||||||
```
|
```
|
@@ -1,6 +1,8 @@
|
|||||||
Тег {foreach}
|
Тег {foreach}
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
Тег `foreach` предоставляет простой способ перебора массивов.
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{foreach $list as [$key =>] $value [index=$index] [first=$first] [last=$last]}
|
{foreach $list as [$key =>] $value [index=$index] [first=$first] [last=$last]}
|
||||||
{* ...code... *}
|
{* ...code... *}
|
||||||
@@ -81,6 +83,5 @@
|
|||||||
|
|
||||||
В блоке `{foreachelse}...{/foreach}` использование `{break}`, `{continue}` выбросит исключение `Fenom\CompileException` при компиляции
|
В блоке `{foreachelse}...{/foreach}` использование `{break}`, `{continue}` выбросит исключение `Fenom\CompileException` при компиляции
|
||||||
|
|
||||||
### Notice
|
**Замечание:**
|
||||||
|
|
||||||
Использование last требует от `$list` быть **countable**.
|
Использование last требует от `$list` быть **countable**.
|
@@ -1,9 +1,9 @@
|
|||||||
Тег {ignore}
|
Тег {ignore}
|
||||||
============
|
============
|
||||||
|
|
||||||
{ignore} tags allow a block of data to be taken literally.
|
Теги `{ignore}{/ignore}` позволяют игнорировать заключенные в них другие теги.
|
||||||
This is typically used around Javascript or stylesheet blocks where {curly braces} would interfere with the template delimiter syntax.
|
Весь текст внутри тегов `{ignore}{/ignore}` не интерпретируется, а выводится "как есть".
|
||||||
Anything within {ignore}{/ignore} tags is not interpreted, but displayed as-is.
|
Обычно они используются вместе с javascript или таблицами стилей, в которых фигурные скобки конфликтуют с синтаксисом разделителей.
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{ignore}
|
{ignore}
|
||||||
@@ -11,8 +11,8 @@ Anything within {ignore}{/ignore} tags is not interpreted, but displayed as-is.
|
|||||||
{/ignore}
|
{/ignore}
|
||||||
```
|
```
|
||||||
|
|
||||||
{ignore} tags are normally not necessary, as Fenom ignores delimiters that are surrounded by whitespace.
|
Использование тегов {ignore} не всегда обязательное так как Fenom игнорирует фигурные скобки `{` сразу после которых идут пробельные символы.
|
||||||
Be sure your javascript and CSS curly braces are surrounded by whitespace:
|
Убедитесь что открывающие фигурные скобки в JavaScript и CSS имеют хотя бы по пробелу справа:
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
var data = { "time": obj.ts };
|
var data = { "time": obj.ts };
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
Tag {include}
|
Тег {include}
|
||||||
=============
|
=============
|
||||||
|
|
||||||
Тэги `{include}` используются для включения других шаблонов в текущий. Любые переменные, доступные в текущем шаблоне, доступны и во включаемом.
|
Тэги `{include}` используются для включения других шаблонов в текущий. Любые переменные, доступные в текущем шаблоне, доступны и во включаемом.
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
Tag {raw}
|
Тег {raw}
|
||||||
=========
|
=========
|
||||||
|
|
||||||
Tag `{raw <expression>}` allow outputs render results without escaping.
|
Тег `{raw <expression>}` позволяет вывести результат выражения без экранирования.
|
||||||
This tag rewrite global option `auto_escape` for specified code.
|
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{autoescape true}
|
{autoescape true}
|
||||||
@@ -16,7 +16,7 @@ This tag rewrite global option `auto_escape` for specified code.
|
|||||||
{/autoescate}
|
{/autoescate}
|
||||||
```
|
```
|
||||||
|
|
||||||
For functions use tag with prefix `raw:`:
|
Для функций используйте параметр тега `:raw`:
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
{autoescape true}
|
{autoescape true}
|
||||||
@@ -25,6 +25,4 @@ For functions use tag with prefix `raw:`:
|
|||||||
{my_func:raw page=5} {* unescape *}
|
{my_func:raw page=5} {* unescape *}
|
||||||
...
|
...
|
||||||
{/autoescate}
|
{/autoescate}
|
||||||
```
|
```
|
||||||
|
|
||||||
Tag can not be applied to compilers as `foreach`, `if` and other.
|
|
@@ -1,12 +1,12 @@
|
|||||||
Tag {unset}
|
Тег {unset}
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Unset a given variables.
|
Удаляет переменные.
|
||||||
|
|
||||||
```smarty
|
```smarty
|
||||||
|
|
||||||
{unset $a} unset single variable
|
{unset $a} единичное удаление
|
||||||
|
|
||||||
{unset $a $b $c.d.e} multiple unset
|
{unset $a $b $c.d.e} множественное удаление
|
||||||
|
|
||||||
```
|
```
|
Reference in New Issue
Block a user