mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #5364 from robbieaverill/feature/json-dbfield-formatting
FIX #5363 Add .JSON option for templates
This commit is contained in:
commit
0a3e39b96c
@ -244,6 +244,14 @@ abstract class DBField extends ViewableData {
|
||||
return Convert::raw2js($this->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return JSON encoded value
|
||||
* @return string
|
||||
*/
|
||||
public function JSON() {
|
||||
return Convert::raw2json($this->value);
|
||||
}
|
||||
|
||||
public function HTML(){
|
||||
return Convert::raw2xml($this->value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user