Skip to content

Commit 1ceba4a

Browse files
committed
changing the default extension for some options
1 parent 950bb06 commit 1ceba4a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ You can also:
144144
The requirements for using filters with Pattern Lab:
145145

146146
* Files must go in `source/_twig-components/filters`
147-
* Files must have the extension `.filter.twig` (_this can be modified in the config_)
147+
* Files must have the extension `.filter.php` (_this can be modified in the config_)
148148
* The filter **must** set the variable `$filter`
149149
* Only one filter per file (_e.g. can only set `$filter` once per file_)
150150

@@ -171,7 +171,7 @@ This filter would be used like this in a pattern:
171171
The requirements for using functions with Pattern Lab:
172172

173173
* Files must go in `source/_twig-components/functions`
174-
* Files must have the extension `.function.twig` (_this can be modified in the config_)
174+
* Files must have the extension `.function.php` (_this can be modified in the config_)
175175
* The function **must** set the variable `$function`
176176
* Only one function per file (_e.g. can only set `$function` once per file_)
177177

@@ -198,7 +198,7 @@ This function would be used like this in a pattern:
198198
The requirements for using tests with Pattern Lab:
199199

200200
* Files must go in `source/_twig-components/tests`
201-
* Files must have the extension `.test.twig` (_this can be modified in the config_)
201+
* Files must have the extension `.test.php` (_this can be modified in the config_)
202202
* The test **must** set the variable `$test`
203203
* Only one test per file (_e.g. can only set `$test` once per file_)
204204

@@ -242,7 +242,7 @@ Where the JSON for the data to set `shirt` would be:
242242
The requirements for using tags with Pattern Lab:
243243

244244
* Files must go in `source/_twig-components/tags`
245-
* Files must have the extension `.tag.twig` (_this can be modified in the config_)
245+
* Files must have the extension `.tag.php` (_this can be modified in the config_)
246246
* The filename **must** be reflected in class names. (e.g. `Project_{filename}_Node` and `Project_{filename}_TokenParser`)
247247
* Only one tag per file
248248

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"twigDefaultDateFormat": "",
3737
"twigDefaultIntervalFormat": "",
3838
"twigMacroExt": "macro.twig",
39-
"twigFilterExt": "filter.twig",
40-
"twigFunctionExt": "function.twig",
41-
"twigTagExt": "tag.twig",
42-
"twigTestExt": "test.twig"
39+
"twigFilterExt": "filter.php",
40+
"twigFunctionExt": "function.php",
41+
"twigTagExt": "tag.php",
42+
"twigTestExt": "test.php"
4343
}
4444
]
4545
}

src/PatternLab/PatternEngine/Twig/TwigUtil.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static function loadFilters($instance) {
7373
// load defaults
7474
$filterDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/filters";
7575
$filterExt = Config::getOption("twigFilterExt");
76-
$filterExt = $filterExt ? $filterExt : "filter.twig";
76+
$filterExt = $filterExt ? $filterExt : "filter.php";
7777

7878
if (is_dir($filterDir)) {
7979

@@ -120,7 +120,7 @@ public static function loadFunctions($instance) {
120120
// load defaults
121121
$functionDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/functions";
122122
$functionExt = Config::getOption("twigFunctionExt");
123-
$functionExt = $functionExt ? $functionExt : "function.twig";
123+
$functionExt = $functionExt ? $functionExt : "function.php";
124124

125125
if (is_dir($functionDir)) {
126126

@@ -209,7 +209,7 @@ public static function loadTags($instance) {
209209
// load defaults
210210
$tagDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/tags";
211211
$tagExt = Config::getOption("twigTagExt");
212-
$tagExt = $tagExt ? $tagExt : "tag.twig";
212+
$tagExt = $tagExt ? $tagExt : "tag.php";
213213

214214
if (is_dir($tagDir)) {
215215

@@ -254,7 +254,7 @@ public static function loadTests($instance) {
254254
// load defaults
255255
$testDir = Config::getOption("sourceDir").DIRECTORY_SEPARATOR."_twig-components/tests";
256256
$testExt = Config::getOption("twigTestExt");
257-
$testExt = $testExt ? $testExt : "test.twig";
257+
$testExt = $testExt ? $testExt : "test.php";
258258

259259
if (is_dir($testDir)) {
260260

0 commit comments

Comments
 (0)