mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Upd docs
This commit is contained in:
parent
9d25ec31a7
commit
36ab6bd08a
@ -24,6 +24,7 @@ Templates looks like Smarty:
|
||||
Display template
|
||||
|
||||
```php
|
||||
<?php
|
||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||
$aspect->display("pages/about.tpl", $data);
|
||||
```
|
||||
@ -31,6 +32,7 @@ $aspect->display("pages/about.tpl", $data);
|
||||
Fetch template's result^
|
||||
|
||||
```php
|
||||
<?php
|
||||
$aspect = Aspect::factory('./templates', './compiled', Aspect::CHECK_MTIME);
|
||||
$content = $aspect->fetch("pages/about.tpl", $data);
|
||||
```
|
||||
@ -38,6 +40,7 @@ $content = $aspect->fetch("pages/about.tpl", $data);
|
||||
Runtime compilation
|
||||
|
||||
```php
|
||||
<?php
|
||||
$aspect = new Aspect();
|
||||
$tempate = $aspect->compileCode('Hello {$user.name}! {if $user.email?} Your email: {$user.email} {/if}');
|
||||
$tempate->display($data);
|
||||
|
Loading…
Reference in New Issue
Block a user