Upload files to "/"
This commit is contained in:
21
custom-twig-extension.php
Normal file
21
custom-twig-extension.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
class CustomTwigExtension extends \Twig\Extension\AbstractExtension implements \Twig\Extension\GlobalsInterface
|
||||
{
|
||||
public function getFilters()
|
||||
{
|
||||
return [
|
||||
new \Twig\TwigFilter('json_decode', [$this, 'jsonDecode']),
|
||||
];
|
||||
}
|
||||
|
||||
public function getGlobals(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function jsonDecode($json)
|
||||
{
|
||||
return json_decode($json, true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user