Skip to content

Commit 761c8ac

Browse files
committed
updating docs
1 parent 368e27c commit 761c8ac

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ Pattern Lab PHP uses [Composer](https://getcomposer.org/) to manage project depe
88

99
composer require pattern-lab/patternengine-twig
1010

11+
## Using Twig Macros
12+
13+
The Twig PatternEngine will automatically find and load Twig macros making them available to every pattern. To use this feature add your `.macro` files to `source/_macros/`. If your macro file is called `forms.macro` and it has a macro called `input()` you'd access it in your Twig templates as `{{ forms.input() }}`. **Please note:** ensure that there is no overlap between the keys for your macros and the keys for your data attributes.
14+
15+
## Enabling `dump()`
16+
17+
To use `dump()` set `twigDebug` in `configs/config.yml` to `true`.
18+
19+
## Modifying the Default Date and Interval Format
20+
21+
You can modify the default date and interval formats for Twig by editing the `twigDefaultDateFormat` and `twigDefaultIntervalFormat` in `configs/config.yml`. Set them to an empty string to use Twig's default formats. **Please note:** both must be set for this feature to work.
22+
1123
## Available Loaders
1224

1325
If you're building a plugin that will be parsing Twig files you have access to three loaders. It's recommended that you use these instead of accessing Twig directly as these loaders will work with other PatternEngines.

0 commit comments

Comments
 (0)