I have Checkbox fields set up in DOM, they work cool, do what i want them to do, but what i realy need is for it to return to page in a more human readable format of Yes or No instead of Boolean 1 or 0, how can i do this?, i dont see any reference to how its done..
My Class file is:
class DogsForAdoptionClass extends DataObject
{
static $db = array (
'Title' => 'Text',
'Caption' => 'Text',
'Inocculated' => 'Boolean',
'Rabies' => 'Boolean',
'Spayed' => 'Boolean',
'Microchipped' => 'Boolean',
);
static $has_one = array (
'Attachment' => 'Image',
'DogsForAdoptionPage' => 'DogsForAdoptionPage'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Title'),
new TextareaField('Caption'),
new FileIFrameField('Attachment'),
new CheckboxField( 'Inocculated') ,
new CheckboxField( 'Rabies'),
new CheckboxField( 'Spayed'),
new CheckboxField( 'Microchipped'),
);
}
}
and Page type is:
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeFieldFromTab('Root.Content.Main', 'MainPageContent');
$manager = new ImageDataObjectManager(
$this, // Controller
'Images', // Source name
'DogsForAdoptionClass', // Source class
'Attachment', // File name on DataObject
array(
'Title' => 'Title',
'Caption' => 'Caption',
'Inocculated' => 'Inocculated',
'Rabies' => 'Rabies',
'Spayed' => 'Spayed',
'Microchipped' => 'Microchipped'
), // Headings
'getCMSFields_forPopup' // Detail fields
// Filter clause
// Sort clause
// Join clause
);
$fields->addFieldToTab("Root.Content.Main",$manager);
return $fields;
}
Thanks in advance