Skip to content

Commit

Permalink
feat(twig.gmdate): add gmdate fn [closes #34]
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Aug 18, 2018
1 parent f1f1f7d commit 678a9c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Generator/TwigGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ protected function initTwig()
$this->twig->addFilter(new \Twig_SimpleFilter('lcfirst', function ($x) {
return \lcfirst($x);
}));

$this->twig->addFunction(new \Twig_Function('gmdate', function ($f = null) {
return \gmdate($f ?? 'Y-m-d H:i:s');
}));
}

protected function findTemplates(string $templatePath)
Expand Down

0 comments on commit 678a9c5

Please sign in to comment.