|
|
@@ -58,6 +58,7 @@ class FrontendTwigExtension extends AbstractExtension |
|
|
|
new TwigFunction('get_form_newsletter', [$this, 'getFormNewsletter']), |
|
|
|
new TwigFunction('get_merchants', [$this, 'getMerchants']), |
|
|
|
new TwigFunction('get_file_manager_folder', [$this, 'getFileManagerFolder']), |
|
|
|
new TwigFilter('lc_format_price', [$this, 'formatPrice']), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
@@ -91,10 +92,12 @@ class FrontendTwigExtension extends AbstractExtension |
|
|
|
return $form->createView(); |
|
|
|
} |
|
|
|
|
|
|
|
public function formatPrice($price) |
|
|
|
public function formatPrice($price, $unbreakableSpace = true) |
|
|
|
{ |
|
|
|
$price = number_format($price, 2, ',', ' '); |
|
|
|
$price = $price . ' €'; |
|
|
|
$price .= $unbreakableSpace ? ' ' : ' ' ; |
|
|
|
$price .= '€' ; |
|
|
|
return $price; |
|
|
|
} |
|
|
|
|