silverstripe-framework/src/Forms/CheckboxField_Readonly.php
2017-04-28 14:59:42 +12:00

28 lines
534 B
PHP

<?php
namespace SilverStripe\Forms;
/**
* Readonly version of a checkbox field - "Yes" or "No".
*/
class CheckboxField_Readonly extends ReadonlyField
{
public function performReadonlyTransformation()
{
return clone $this;
}
public function Value()
{
return $this->value ?
_t('SilverStripe\\Forms\\CheckboxField.YESANSWER', 'Yes') :
_t('SilverStripe\\Forms\\CheckboxField.NOANSWER', 'No');
}
public function getValueCast()
{
return 'Text';
}
}