mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Upd doc
This commit is contained in:
parent
439533f5ad
commit
e498f4042f
@ -8,6 +8,7 @@ Aspect templater
|
|||||||
Отрисовать шаблон `pages/about.tpl`:
|
Отрисовать шаблон `pages/about.tpl`:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
<?php
|
||||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||||
$aspect->display("pages/about.tpl", $data);
|
$aspect->display("pages/about.tpl", $data);
|
||||||
```
|
```
|
||||||
@ -15,6 +16,7 @@ $aspect->display("pages/about.tpl", $data);
|
|||||||
Получить результат отрисовки шаблона:
|
Получить результат отрисовки шаблона:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
<?php
|
||||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||||
$content = $aspect->fetch("pages/about.tpl", $data);
|
$content = $aspect->fetch("pages/about.tpl", $data);
|
||||||
```
|
```
|
||||||
@ -22,6 +24,7 @@ $content = $aspect->fetch("pages/about.tpl", $data);
|
|||||||
Создание шаблона в реальном времени:
|
Создание шаблона в реальном времени:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
<?php
|
||||||
$aspect = new Aspect();
|
$aspect = new Aspect();
|
||||||
$tempate = $aspect->compileCode('Hello {$user.name}! {if $user.email?} Your email: {$user.email} {/if}');
|
$tempate = $aspect->compileCode('Hello {$user.name}! {if $user.email?} Your email: {$user.email} {/if}');
|
||||||
$tempate->display($data);
|
$tempate->display($data);
|
||||||
|
Loading…
Reference in New Issue
Block a user