Skip to content

Commit 276f862

Browse files
committed
Allow .pug or any custom (single or multiple) extensions
1 parent 91662b2 commit 276f862

File tree

3 files changed

+103
-2
lines changed

3 files changed

+103
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"description": "Pug template engine for Symfony",
77
"type": "library",
88
"require": {
9-
"pug-php/pug": "^1.8"
9+
"pug-php/pug": "^1.12.2"
1010
},
1111
"license": "MIT",
1212
"authors": [

composer.lock

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Jade/JadeSymfonyEngine.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ public function exists($name)
114114

115115
public function supports($name)
116116
{
117-
return substr($name, -5) === $this->getOption('extension');
117+
foreach ($this->jade->getExtensions() as $extension) {
118+
if (substr($name, -strlen($extension)) === $extension) {
119+
return true;
120+
}
121+
}
122+
123+
return false;
118124
}
119125

120126
public function offsetGet($name)

0 commit comments

Comments
 (0)