mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Update docs
This commit is contained in:
parent
968671d8a7
commit
6e011b1a44
@ -4,7 +4,7 @@ Fenom - Template Engine for PHP
|
|||||||
> Composer package: `{"fenom/fenom": "dev-master"}`. See on [Packagist.org](https://packagist.org/packages/bzick/fenom)
|
> Composer package: `{"fenom/fenom": "dev-master"}`. See on [Packagist.org](https://packagist.org/packages/bzick/fenom)
|
||||||
|
|
||||||
[](https://travis-ci.org/bzick/fenom)
|
[](https://travis-ci.org/bzick/fenom)
|
||||||
## [Usage](./docs/usage.md) :: [Documentation](./docs/main.md) :: [Benchmark](./docs/benchmark.md) :: [Articles](./docs/articles.md)
|
## [Usage](./docs/usage.md) :: [Documentation](./docs/readme.md) :: [Benchmark](./docs/benchmark.md) :: [Articles](./docs/articles.md)
|
||||||
|
|
||||||
* Simple [syntax](./docs/syntax.md)
|
* Simple [syntax](./docs/syntax.md)
|
||||||
* [Fast](./docs/benchmark.md)
|
* [Fast](./docs/benchmark.md)
|
||||||
|
@ -29,7 +29,7 @@ Documentation
|
|||||||
* [in](./mods/in.md)
|
* [in](./mods/in.md)
|
||||||
* allowed functions: `json_encode`, `json_decode`, `count`, `is_string`, `is_array`, `is_numeric`, `is_int`, `is_object`,
|
* allowed functions: `json_encode`, `json_decode`, `count`, `is_string`, `is_array`, `is_numeric`, `is_int`, `is_object`,
|
||||||
`strtotime`, `gettype`, `is_double`, `ip2long`, `long2ip`, `strip_tags`, `nl2br`
|
`strtotime`, `gettype`, `is_double`, `ip2long`, `long2ip`, `strip_tags`, `nl2br`
|
||||||
* or [add](./ext/mods.md) your own
|
* or [add](./ext/mods.md) yours
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
@ -48,7 +48,9 @@ Documentation
|
|||||||
* [filter](./tags/filter.md)
|
* [filter](./tags/filter.md)
|
||||||
* [ignore](./tags/ignore.md)
|
* [ignore](./tags/ignore.md)
|
||||||
* [macro](./tags/macro.md) and `import`
|
* [macro](./tags/macro.md) and `import`
|
||||||
* or [add](./ext/tags.md) your own
|
* [autoescape](./tags/autoescape.md)
|
||||||
|
* [raw](./tags/raw.md)
|
||||||
|
* or [add](./ext/tags.md) yours
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
@ -26,6 +26,7 @@ $fenom->setOptions($options);
|
|||||||
* **force_compile**, `Fenom::FORCE_COMPILE`, пересобирать шаблон при каждом вызове (сильно замедляет работу шаблонизатора).
|
* **force_compile**, `Fenom::FORCE_COMPILE`, пересобирать шаблон при каждом вызове (сильно замедляет работу шаблонизатора).
|
||||||
* **force_include**, `Fenom::FORCE_INCLUDE`, оптимизировать вставку шаблона в шаблон. Это увеличит производительность и размер собранного шаблона.
|
* **force_include**, `Fenom::FORCE_INCLUDE`, оптимизировать вставку шаблона в шаблон. Это увеличит производительность и размер собранного шаблона.
|
||||||
Опция активируется если имя шаблона задано явно и скалярно.
|
Опция активируется если имя шаблона задано явно и скалярно.
|
||||||
|
* **auto_escape**, `Fenom::AUTO_ESCAPE`, все выводящие переменные и результаты функций будут экранироваться
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$fenom->setOptions(array(
|
$fenom->setOptions(array(
|
||||||
|
14
docs/tags/autoescape.md
Normal file
14
docs/tags/autoescape.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
Tag {autoescape} [RU]
|
||||||
|
=====================
|
||||||
|
|
||||||
|
Force enable or disable `auto_escape` option for block area:
|
||||||
|
|
||||||
|
```smarty
|
||||||
|
{autoescape true}
|
||||||
|
...
|
||||||
|
Text: {$text} {* value of the variable $text will be escaped *}
|
||||||
|
...
|
||||||
|
{/autoescape}
|
||||||
|
```
|
||||||
|
|
||||||
|
Also see {raw} tag for
|
@ -1,17 +0,0 @@
|
|||||||
Tag {capture}
|
|
||||||
=============
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```smarty
|
|
||||||
{capture $var}
|
|
||||||
This content will be captured into variable $var
|
|
||||||
{/capture}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
```smarty
|
|
||||||
{capture|stip_tags $var}
|
|
||||||
This content will be captured into variable $var and all tags will be stripped
|
|
||||||
{/capture}
|
|
||||||
```
|
|
36
docs/tags/raw.md
Normal file
36
docs/tags/raw.md
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
Tag {raw} [RU]
|
||||||
|
==================
|
||||||
|
|
||||||
|
Тег `{raw <expression>}` позволяет не экранировать результат выражения если включена глобальная настройка экранирование вывода или выражение распологасется в экранироуемой области.
|
||||||
|
|
||||||
|
```smarty
|
||||||
|
{autoescape true}
|
||||||
|
...
|
||||||
|
{$var|up} {* escape *}
|
||||||
|
{raw $var|up} {* unescape *}
|
||||||
|
...
|
||||||
|
{"name is: <b>{$name|low}</b>"} {* escape *}
|
||||||
|
{raw "name is: <b>{$name|low}</b>"} {* unescape *}
|
||||||
|
...
|
||||||
|
{/autoescate}
|
||||||
|
```
|
||||||
|
|
||||||
|
Для результатов функций так же может быть отключено экранирование:
|
||||||
|
|
||||||
|
```smarty
|
||||||
|
{autoescape true}
|
||||||
|
...
|
||||||
|
{my_func page=5} {* escape *}
|
||||||
|
{raw:my_func page=5} {* unescape *}
|
||||||
|
...
|
||||||
|
{my_block_func page=5}
|
||||||
|
...
|
||||||
|
{/my_block_func} {* escape *}
|
||||||
|
{raw:my_block_func page=5}
|
||||||
|
...
|
||||||
|
{/my_block_func} {* unescape *}
|
||||||
|
...
|
||||||
|
{/autoescate}
|
||||||
|
```
|
||||||
|
|
||||||
|
На компиляторы свойство raw не распространяется.
|
Loading…
x
Reference in New Issue
Block a user