Skip to content

Instantly share code, notes, and snippets.

Created November 5, 2015 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a7585676620a082a6a48 to your computer and use it in GitHub Desktop.
Save anonymous/a7585676620a082a6a48 to your computer and use it in GitHub Desktop.
---
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 '
<?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;
}
}
<div class="price">
<span>$PricePerNight.SymbolNice</span><p>per night<p>
</div>
@muskie9
Copy link

muskie9 commented Nov 5, 2015

---
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
Currency:
  currency_symbol: 'DKK '
  extensions:
    - CurrencySymbol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment