-
-
Save anonymous/a7585676620a082a6a48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
Name: mysite | |
After: | |
- 'framework/*' | |
- 'cms/*' | |
--- | |
# YAML configuration for SilverStripe | |
# See http://doc.silverstripe.org/framework/en/topics/configuration | |
# Caution: Indentation through two spaces, not tabs | |
SSViewer: | |
theme: 'one-ring' | |
SiteConfig: | |
extensions: | |
- SiteConfigExtension | |
- CurrencySymbol | |
Currency: | |
currency_symbol: 'DKK ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class CurrencySymbol extends DataExtension { | |
public function SymbolNice() { | |
$val = number_format(abs($this->value) . $this->config()->currency_symbol, 2); | |
if($this->value < 0) return "($val)"; | |
else return $val; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="price"> | |
<span>$PricePerNight.SymbolNice</span><p>per night<p> | |
</div> |
muskie9
commented
Nov 5, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment