protected function CodeMirrorPluginTrait::formatBoolean in The CodeMirror Editor 8
Returns formatted boolean setting value.
Parameters
string $key: Plugin setting key to format.
Return value
string Format settings value.
2 calls to CodeMirrorPluginTrait::formatBoolean()
- CodemirrorEditorFormatter::settingsSummary in src/
Plugin/ Field/ FieldFormatter/ CodemirrorEditorFormatter.php - Returns a short summary for the current formatter settings.
- CodeMirrorEditorWidget::settingsSummary in src/
Plugin/ Field/ FieldWidget/ CodeMirrorEditorWidget.php - Returns a short summary for the current widget settings.
File
- src/
CodeMirrorPluginTrait.php, line 167
Class
- CodeMirrorPluginTrait
- Provides a helper methods to for CodeMirror plugins.
Namespace
Drupal\codemirror_editorCode
protected function formatBoolean($key) {
return $this->settings[$key] ? $this
->t('Yes') : $this
->t('No');
}