mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
29 lines
430 B
PHP
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';
|
||
|
}
|
||
|
|
||
|
}
|