silverstripe-framework/Forms/CheckboxField_Readonly.php
Damian Mooyman 8dd644d25d
API Namespace all classes
Namespace all templates
Move difflib and BBCodeParser2 to thirdparty
Remove deprecated API marked for removal in 4.0
2016-09-08 10:23:17 +12:00

29 lines
430 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('CheckboxField.YESANSWER', 'Yes') :
_t('CheckboxField.NOANSWER', 'No');
}
public function getValueCast()
{
return 'Text';
}
}