|
|
|
|
|
|
|
|
new TwigFunction('ea_url_short', [$this, 'generateEaUrl']), |
|
|
new TwigFunction('ea_url_short', [$this, 'generateEaUrl']), |
|
|
new TwigFunction('is_instance_of', [$this, 'isInstanceOf']), |
|
|
new TwigFunction('is_instance_of', [$this, 'isInstanceOf']), |
|
|
new TwigFunction('logo_admin', [$this, 'getLogoAdmin']), |
|
|
new TwigFunction('logo_admin', [$this, 'getLogoAdmin']), |
|
|
|
|
|
new TwigFunction('asset_url', [$this, 'getAssetUrl']), |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function getAssetUrl($path) |
|
|
|
|
|
{ |
|
|
|
|
|
$context = $this->router->getContext(); |
|
|
|
|
|
$host = $context->getScheme().'://'.$context->getHost().'/'; |
|
|
|
|
|
|
|
|
|
|
|
return $host.$path; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function rot13(string $string): string |
|
|
public function rot13(string $string): string |
|
|
{ |
|
|
{ |
|
|
return str_rot13($string); |
|
|
return str_rot13($string); |