public function BooleanYesNo::getFormats in Boolean formatter 8
2 calls to BooleanYesNo::getFormats()
- BooleanYesNo::displayValueWithFormat in lib/
Drupal/ boolean_formatter/ Plugin/ field/ formatter/ BooleanYesNo.php - BooleanYesNo::getFormatOptions in lib/
Drupal/ boolean_formatter/ Plugin/ field/ formatter/ BooleanYesNo.php
File
- lib/
Drupal/ boolean_formatter/ Plugin/ field/ formatter/ BooleanYesNo.php, line 103 - Contains \Drupal\boolean_formatter\Plugin\field\formatter\BooleanYesNo.
Class
- BooleanYesNo
- Plugin implementation of the 'boolean_formatter' formatter.
Namespace
Drupal\boolean_formatter\Plugin\field\formatterCode
public function getFormats(array $options = array()) {
$formats = array(
'yes-no' => array(
t('Yes'),
t('No'),
),
'true-false' => array(
t('True'),
t('False'),
),
'on-off' => array(
t('On'),
t('Off'),
),
'enabled-disabled' => array(
t('Enabled'),
t('Disabled'),
),
'boolean' => array(
1,
0,
),
'unicode-yes-no' => array(
'✔',
'✖',
),
'custom' => array(
t('Custom'),
),
);
if (isset($options['custom_on']) && isset($options['custom_off'])) {
$formats['custom'] = array(
$options['custom_on'],
$options['custom_off'],
);
}
return $formats;
}