et-innovations/silverstripe-localcurrency is a Laravel package for localized currencies.
It currently has 0 GitHub stars and 0 downloads on Packagist.
Install it with composer require et-innovations/silverstripe-localcurrency.
Discover more Laravel packages by et-innovations
or browse all Laravel packages to compare alternatives.
Last updated
Translatable fieldtypes for:
Install via composer composer require et-innovations/silverstripe-localcurrency
or extract the contents of this repository into the root-folder of your project.
Simply create the wished field in the array $db:
class MyDataObject extends DataObject {
public static $db = array(
'SomeCurrencyField' => "LocalCurrency",
);
}
To get translated value in GridField, you need to declare a function with the same name as the field and return the value as wished:
class MyDataObject extends DataObject {
...
public function SomeCurrencyField() {
if($this->{__FUNCTION__})
return DBField::create_field('LocalCurrency', $this->{__FUNCTION__})->Nice();
}
}