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
5632d40601
commit
2b0bf5e23b
18
README.md
18
README.md
@ -8,26 +8,24 @@ Aspect templater
|
||||
Отрисовать шаблон `pages/about.tpl`:
|
||||
|
||||
```php
|
||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||
$aspect->display("pages/about.tpl", $data);
|
||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||
$aspect->display("pages/about.tpl", $data);
|
||||
```
|
||||
|
||||
Получить результат отрисовки шаблона:
|
||||
|
||||
```php
|
||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||
$content = $aspect->fetch("pages/about.tpl", $data);
|
||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||
$content = $aspect->fetch("pages/about.tpl", $data);
|
||||
```
|
||||
|
||||
Создание шаблона в реальном времени:
|
||||
|
||||
```php
|
||||
use MF\Aspect;
|
||||
$aspect = new Aspect();
|
||||
$tempate = $aspect->compileCode('Hello {$user.name}! {if $user.email?} Your email: {$user.email} {/if}');
|
||||
|
||||
$tempate->display($data);
|
||||
$content = $tempate->fetch($data);
|
||||
$aspect = new Aspect();
|
||||
$tempate = $aspect->compileCode('Hello {$user.name}! {if $user.email?} Your email: {$user.email} {/if}');
|
||||
$tempate->display($data);
|
||||
$content = $tempate->fetch($data);
|
||||
```
|
||||
|
||||
## Синтаксис
|
||||
|
Loading…
Reference in New Issue
Block a user