Namespace and ClassPath rewrites
This commit is contained in:
18
Core/Objects/CustomTwigFunctions.class.php
Normal file
18
Core/Objects/CustomTwigFunctions.class.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Objects;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
class CustomTwigFunctions extends AbstractExtension {
|
||||
public function getFunctions(): array {
|
||||
return [
|
||||
new TwigFunction('L', array($this, 'translate')),
|
||||
];
|
||||
}
|
||||
|
||||
public function translate(string $key): string {
|
||||
return L($key);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user