瀏覽代碼

Merge branch 'develop'

develop
Guillaume 2 年之前
父節點
當前提交
7a8f28f72d
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      Twig/TwigExtension.php

+ 10
- 0
Twig/TwigExtension.php 查看文件

@@ -99,6 +99,7 @@ class TwigExtension extends AbstractExtension
new TwigFunction('ea_url_short', [$this, 'generateEaUrl']),
new TwigFunction('is_instance_of', [$this, 'isInstanceOf']),
new TwigFunction('logo_admin', [$this, 'getLogoAdmin']),
new TwigFunction('asset_url', [$this, 'getAssetUrl']),
];
}

@@ -119,6 +120,15 @@ class TwigExtension extends AbstractExtension
];
}

public function getAssetUrl($path)
{
$context = $this->router->getContext();
$host = $context->getScheme().'://'.$context->getHost().'/';

return $host.$path;
}


public function rot13(string $string): string
{
return str_rot13($string);

Loading…
取消
儲存