Skip to content

Commit

Permalink
Added json_decode twig filter
Browse files Browse the repository at this point in the history
  • Loading branch information
krazzer committed Jul 8, 2024
1 parent 803ecef commit 00bc8c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Classes/Phalcon/Twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ protected function registryFunctions(DiInterface $di): void
// add lcfirst filter
$this->twig->addFilter(new TwigFilter('lcfirst', 'lcfirst'));

// add json_decode filter
$this->twig->addFilter(new TwigFilter('json_decode', 'json_decode'));

// add price filter
$this->twig->addFilter(new TwigFilter('price', function ($price, $decimals = 2) use ($di) {
return $di->getShared("numberService")->getPriceFormat((float) $price, $decimals);
Expand Down

0 comments on commit 00bc8c4

Please sign in to comment.