Skip to content

Commit

Permalink
document custom tags & filters
Browse files Browse the repository at this point in the history
  • Loading branch information
cappuc committed Dec 30, 2024
1 parent a3cdd8b commit 2e9e86a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,27 @@ $environment = \Keepsuit\Liquid\EnvironmentFactory::new()
$environment->addExtension(new CustomExtension());
```

## Custom tags and filters

By default, only the standard liquid tags and filters are available.
But this package provides some custom tags and filters that you can use.

### Tags

- `DynamicRender`: This tag replace the default `Render` tag and allows to render dynamic templates (eg. read template name from a variable).

### Filters

- `TernaryFilter`
- `ternary`: adds a ternary operator.
```liquid
{{ condition | ternary: true_value, false_value }}
# Example
{{ true | ternary: 'yes', 'no' }} # yes
{{ false | ternary: 'yes', 'no' }} # no
```
## Testing
```bash
Expand Down

0 comments on commit 2e9e86a

Please sign in to comment.