|
|
|
|
|
|
|
|
new TwigFunction('sov_get_by_devalias', [$this, 'getByDevAlias']), |
|
|
new TwigFunction('sov_get_by_devalias', [$this, 'getByDevAlias']), |
|
|
new TwigFunction('sov_parameter', [$this, 'getParameter']), |
|
|
new TwigFunction('sov_parameter', [$this, 'getParameter']), |
|
|
new TwigFunction('sov_homepage_route', [$this, 'getHomepageRoute']), |
|
|
new TwigFunction('sov_homepage_route', [$this, 'getHomepageRoute']), |
|
|
|
|
|
new TwigFunction('lc_format_price', [$this, 'formatPrice']), |
|
|
|
|
|
new TwigFunction('die', [$this, 'die']), |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function die() |
|
|
|
|
|
{ |
|
|
|
|
|
die(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function getFilters() |
|
|
public function getFilters() |
|
|
{ |
|
|
{ |
|
|
return []; |
|
|
|
|
|
|
|
|
return [ |
|
|
|
|
|
new TwigFilter('uc_first', [$this, 'ucFirst']), |
|
|
|
|
|
new TwigFilter('format_price', [$this, 'formatPrice']), |
|
|
|
|
|
|
|
|
|
|
|
]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function formatPrice($price, $unbreakableSpace = true) |
|
|
|
|
|
{ |
|
|
|
|
|
$price = number_format($price, 2, ',', ' '); |
|
|
|
|
|
$price .= $unbreakableSpace ? ' ' : ' '; |
|
|
|
|
|
$price .= '€'; |
|
|
|
|
|
|
|
|
|
|
|
return $price; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function ucFirst($string) |
|
|
|
|
|
{ |
|
|
|
|
|
return ucfirst($string); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function liip($path, $thumb = 'tile', $default = 'default.jpg') |
|
|
public function liip($path, $thumb = 'tile', $default = 'default.jpg') |
|
|
|
|
|
|
|
|
$fileManagerFolder = substr($this->getFileManagerFolder(), 1); |
|
|
$fileManagerFolder = substr($this->getFileManagerFolder(), 1); |
|
|
|
|
|
|
|
|
if (strpos($path, $fileManagerFolder) === false) { |
|
|
if (strpos($path, $fileManagerFolder) === false) { |
|
|
$path = $fileManagerFolder . '/' . $path; |
|
|
|
|
|
|
|
|
$path = $fileManagerFolder.'/'.$path; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (file_exists($path)) { |
|
|
if (file_exists($path)) { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder() . '/' . $default, $thumb); |
|
|
|
|
|
|
|
|
return $this->cacheManager->getBrowserPath($this->getFileManagerFolder().'/'.$default, $thumb); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getFileManagerFolder() |
|
|
public function getFileManagerFolder() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getParameter($name) |
|
|
public function getParameter($name) |
|
|
{ |
|
|
{ |
|
|
return $this->parameterBag->get($name) ; |
|
|
|
|
|
|
|
|
return $this->parameterBag->get($name); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |