class Boolean in Smart Date 3.x
Same name and namespace in other branches
- 8.2 src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
- 8 src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
- 3.0.x src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
- 3.1.x src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
- 3.2.x src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
- 3.3.x src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
- 3.4.x src/FormElement/Boolean.php \Drupal\smart_date\FormElement\Boolean
Defines the boolean element for the configuration translation interface.
Hierarchy
- class \Drupal\config_translation\FormElement\FormElementBase implements ElementInterface uses StringTranslationTrait
- class \Drupal\smart_date\FormElement\Boolean
Expanded class hierarchy of Boolean
1 string reference to 'Boolean'
- smart_date.schema.yml in config/
schema/ smart_date.schema.yml - config/schema/smart_date.schema.yml
File
- src/
FormElement/ Boolean.php, line 11
Namespace
Drupal\smart_date\FormElementView source
class Boolean extends FormElementBase {
/**
* {@inheritdoc}
*/
public function getTranslationElement(LanguageInterface $translation_language, $source_config, $translation_config) {
return [
'#type' => 'checkbox',
'#return_value' => '1',
] + parent::getTranslationElement($translation_language, $source_config, $translation_config);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Boolean:: |
public | function |
Returns the translation form element for a given configuration definition. Overrides FormElementBase:: |
|
FormElementBase:: |
protected | property | The data definition of the element this form element is for. | |
FormElementBase:: |
protected | property | The schema element this form is for. | |
FormElementBase:: |
public static | function |
Creates a form element instance from a schema definition. Overrides ElementInterface:: |
|
FormElementBase:: |
protected | function | Returns the source element for a given configuration definition. | 2 |
FormElementBase:: |
public | function |
Builds a render array containing the source and translation form elements. Overrides ElementInterface:: |
|
FormElementBase:: |
public | function |
Sets configuration based on a nested form value array. Overrides ElementInterface:: |
1 |
FormElementBase:: |
public | function | Constructs a FormElementBase. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |