瀏覽代碼

Merge branch 'develop' of https://forge.laclic.fr/Laclic/SovBundle into develop

develop
Fab 3 年之前
父節點
當前提交
a816e4115f
共有 1 個檔案被更改,包括 11 行新增1 行删除
  1. +11
    -1
      Twig/TwigExtension.php

+ 11
- 1
Twig/TwigExtension.php 查看文件

@@ -76,10 +76,20 @@ class TwigExtension extends AbstractExtension
return [
new TwigFilter('uc_first', [$this, 'ucFirst']),
new TwigFilter('format_price', [$this, 'formatPrice']),
new TwigFilter('sov_cache', [$this, 'sovCache']),
];
}

public function sovCache($file)
{
$cacheTime = filemtime($this->kernel->getProjectDir() . '/public' . $file);
if ($cacheTime) {
return $file . '?c=' . $cacheTime;
} else {
return $file . "?c=0";
}
}

public function formatPrice($price, $unbreakableSpace = true)
{
$price = number_format($price, 2, ',', ' ');

Loading…
取消
儲存