Skip to content

Commit

Permalink
Allow .pug or any custom (single or multiple) extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Jun 30, 2016
1 parent 91662b2 commit 276f862
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"description": "Pug template engine for Symfony",
"type": "library",
"require": {
"pug-php/pug": "^1.8"
"pug-php/pug": "^1.12.2"
},
"license": "MIT",
"authors": [
Expand Down
95 changes: 95 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/Jade/JadeSymfonyEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ public function exists($name)

public function supports($name)
{
return substr($name, -5) === $this->getOption('extension');
foreach ($this->jade->getExtensions() as $extension) {
if (substr($name, -strlen($extension)) === $extension) {
return true;
}
}

return false;
}

public function offsetGet($name)
Expand Down

0 comments on commit 276f862

Please sign in to comment.