Skip to content

Commit

Permalink
README: added info about using macros/filters
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Sep 4, 2015
1 parent f41ce88 commit cd3d3bb
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Expand Up @@ -50,6 +50,36 @@ You can use all the great features from the Latte.

See more on [official documentation](https://doc.nette.org/en/2.3/templating).

You can use **macros** and **filters**.

#### Macros

Classic macros

```latte
<ul>
{foreach $users as $user}
<li>{$user->name}</li>
{/foreach}
</ul>
```

N-macros

```latte
<ul n:foreach="$users as $user">
<li>{$user->name}</li>
</ul>
```

#### Filters

```latte
{var $time => time()}
It's {$time|date:'d.m.Y'} at {$time|date:'H:i:s'}
```


### Latte Macros

See more on [official documentation](https://doc.nette.org/en/2.3/default-macros).
Expand Down Expand Up @@ -266,5 +296,5 @@ final class MyUltraFilters

```php
$factory = new LatteFactory();
$factory->addFile('sayhi', ['MyUltraFilters', 'hi']);
$factory->addFilter('sayhi', ['MyUltraFilters', 'hi']);
```

0 comments on commit cd3d3bb

Please sign in to comment.