You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,18 @@ Pattern Lab PHP uses [Composer](https://getcomposer.org/) to manage project depe
8
8
9
9
composer require pattern-lab/patternengine-twig
10
10
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
+
11
23
## Available Loaders
12
24
13
25
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