1 <?php
2
3 class ShopCountry extends Varchar{
4
5 function __construct($name, $size = 3, $options = array()) {
6 parent::__construct($name, $size = 3, $options);
7 }
8
9 function forTemplate(){
10 return $this->Nice();
11 }
12
13 14 15
16 function Nice(){
17 $val = Geoip::countryCode2name($this->value);
18 return ($val) ? $val : $this->value;
19 }
20
21 function XML(){
22 return Convert::raw2xml($this->Nice());
23 }
24 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-