mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Merge branch 'origin/master'
Conflicts: CHANGELOG.md docs/tags/raw.md src/Fenom/Compiler.php src/Fenom/Render.php src/Fenom/Template.php
This commit is contained in:
@@ -20,7 +20,15 @@ Tag {macro} [RU]
|
||||
{macro.plus x=$num y=100}
|
||||
```
|
||||
|
||||
На данный момент рекурсивный вызов макроса не поддерживается.
|
||||
Во время рекурсивного вызова используйте суффикс macro что бы обратиться к текущему макросу:
|
||||
|
||||
```smarty
|
||||
{macro plus(x, y, z=0)}
|
||||
...
|
||||
{macro.plus x=2 y=4}
|
||||
...
|
||||
{/macro}
|
||||
```
|
||||
|
||||
### {import}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ For functions use tag with prefix `raw:`:
|
||||
{autoescape true}
|
||||
...
|
||||
{my_func page=5} {* escape *}
|
||||
{raw:my_func page=5} {* unescape *}
|
||||
{my_func:raw page=5} {* unescape *}
|
||||
...
|
||||
{/autoescate}
|
||||
```
|
||||
|
||||
@@ -3,31 +3,31 @@ Basic usage
|
||||
|
||||
### Initialize Fenom
|
||||
|
||||
Use factory method
|
||||
Creating an object via factory method
|
||||
```php
|
||||
$fenom = Fenom::factory('/path/to/templates', '/path/to/compiled/template', $options);
|
||||
```
|
||||
|
||||
Use `new` operator
|
||||
Creating an object via `new` operator
|
||||
```php
|
||||
$fenom = new Fenom(new Provider('/path/to/templates'));
|
||||
$fenom->setCompileDir('/path/to/template/cache');
|
||||
$fenom->setOptions($options);
|
||||
```
|
||||
|
||||
### Render template
|
||||
### Rendering template
|
||||
|
||||
Output template
|
||||
```php
|
||||
$fenom->display("template/name.tpl", $vars);
|
||||
```
|
||||
|
||||
Get template into the variable
|
||||
Get the result of rendering the template
|
||||
```php
|
||||
$result = $fenom->fetch("template/name.tpl", $vars);
|
||||
```
|
||||
|
||||
Create pipe-line into callback
|
||||
Create the pipeline of rendering into callback
|
||||
```php
|
||||
$fenom->pipe(
|
||||
"template/sitemap.tpl",
|
||||
|
||||
Reference in New Issue
Block a user