Skip to content

et-innovations/silverstripe-localcurrency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

silverstripe-localcurrency

Translatable fieldtypes for:

  • Currency

Maintainer Contact

Requirements

  • SilverStripe 3.0

Installation

Install via composer composer require et-innovations/silverstripe-localcurrency or extract the contents of this repository into the root-folder of your project.

Usage Overview

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();
	}
	
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages