abstract class OptionsBase in YAML Form 8
Provides a base 'options' element.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\yamlform\YamlFormElementBase implements YamlFormElementInterface uses StringTranslationTrait
- class \Drupal\yamlform\Plugin\YamlFormElement\OptionsBase
- class \Drupal\yamlform\YamlFormElementBase implements YamlFormElementInterface uses StringTranslationTrait
Expanded class hierarchy of OptionsBase
File
- src/
Plugin/ YamlFormElement/ OptionsBase.php, line 16
Namespace
Drupal\yamlform\Plugin\YamlFormElementView source
abstract class OptionsBase extends YamlFormElementBase {
/**
* Export delta for multiple options.
*
* @var bool
*/
protected $exportDelta = FALSE;
/**
* {@inheritdoc}
*/
public function getDefaultProperties() {
$default_properties = parent::getDefaultProperties();
// Issue #2836374: Wrapper attributes are not supported by composite
// elements, this includes radios, checkboxes, and buttons.
if (preg_match('/(radios|checkboxes|buttons)/', $this
->getPluginId())) {
unset($default_properties['wrapper_attributes']);
}
return $default_properties + [
// Options settings.
'options' => [],
'options_randomize' => FALSE,
];
}
/**
* Get option (option) properties.
*
* @return array
* An associative array containing other (option) properties.
*/
public function getOtherProperties() {
return [
'other__option_label' => $this
->t('Other...'),
'other__type' => 'textfield',
'other__title' => '',
'other__placeholder' => $this
->t('Enter other...'),
'other__description' => '',
// Text field or textarea.
'other__size' => '',
'other__maxlength' => '',
'other__field_prefix' => '',
'other__field_suffix' => '',
// Textarea.
'other__rows' => '',
// Number.
'other__min' => '',
'other__max' => '',
'other__step' => '',
];
}
/**
* {@inheritdoc}
*/
public function getTranslatableProperties() {
return array_merge(parent::getTranslatableProperties(), [
'options',
'empty_option',
'option_label',
]);
}
/**
* {@inheritdoc}
*/
public function getRelatedTypes(array $element) {
$related_types = parent::getRelatedTypes($element);
// Remove entity reference elements.
$elements = $this->elementManager
->getInstances();
foreach ($related_types as $type => $related_type) {
$element_instance = $elements[$type];
if ($element_instance instanceof YamlFormEntityReferenceInterface) {
unset($related_types[$type]);
}
}
return $related_types;
}
/**
* {@inheritdoc}
*/
public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
parent::prepare($element, $yamlform_submission);
// Randomize options.
if (isset($element['#options']) && !empty($element['#options_randomize'])) {
shuffle($element['#options']);
}
$is_wrapper_fieldset = in_array($element['#type'], [
'checkboxes',
'radios',
]);
if ($is_wrapper_fieldset) {
// Issue #2396145: Option #description_display for form element fieldset
// is not changing anything.
// @see core/modules/system/templates/fieldset.html.twig
$is_description_display = isset($element['#description_display']) ? TRUE : FALSE;
$has_description = !empty($element['#description']) ? TRUE : FALSE;
if ($is_description_display && $has_description) {
switch ($element['#description_display']) {
case 'before':
$element += [
'#field_prefix' => '',
];
$element['#field_prefix'] = '<div class="description">' . $element['#description'] . '</div>' . $element['#field_prefix'];
unset($element['#description']);
break;
case 'invisible':
$element += [
'#field_suffix' => '',
];
$element['#field_suffix'] .= '<div class="description visually-hidden">' . $element['#description'] . '</div>';
unset($element['#description']);
break;
}
}
}
}
/**
* {@inheritdoc}
*/
public function hasMultipleValues(array $element) {
return isset($element['#multiple']) ? $element['#multiple'] : parent::hasMultipleValues($element);
}
/**
* {@inheritdoc}
*/
public function setDefaultValue(array &$element) {
if (!isset($element['#default_value'])) {
return;
}
// Compensate for #default_value not being an array, for elements that
// allow for multiple #options to be selected/checked.
if ($this
->hasMultipleValues($element) && !is_array($element['#default_value'])) {
$element['#default_value'] = [
$element['#default_value'],
];
}
}
/**
* {@inheritdoc}
*/
public function formatHtml(array &$element, $value, array $options = []) {
if ($value && is_array($value) && ($list_type = $this
->getListType($element))) {
$flattened_options = OptGroup::flattenOptions($element['#options']);
return [
'#theme' => 'item_list',
'#items' => YamlFormOptionsHelper::getOptionsText($value, $flattened_options),
'#list_type' => $list_type,
];
}
else {
return parent::formatHtml($element, $value, $options);
}
}
/**
* {@inheritdoc}
*/
public function formatText(array &$element, $value, array $options = []) {
// Return empty value.
if ($value === '' || $value === NULL || is_array($value) && empty($value)) {
return '';
}
$format = $this
->getFormat($element);
$flattened_options = OptGroup::flattenOptions($element['#options']);
// If not multiple options array return the simple value.
if (!is_array($value)) {
return $format == 'raw' ? $value : YamlFormOptionsHelper::getOptionText($value, $flattened_options);
}
$options_text = YamlFormOptionsHelper::getOptionsText($value, $flattened_options);
switch ($format) {
case 'ol':
$list = [];
$index = 1;
foreach ($options_text as $option_text) {
$list[] = $index++ . '. ' . $option_text;
}
return implode("\n", $list);
case 'ul':
$list = [];
foreach ($options_text as $index => $option_text) {
$list[] = '- ' . $option_text;
}
return implode("\n", $list);
case 'and':
return YamlFormArrayHelper::toString($options_text, t('and'));
case 'comma':
return implode(', ', $options_text);
case 'semicolon':
return implode('; ', $options_text);
case 'raw':
return implode(', ', $value);
default:
return implode($format, $options_text);
}
}
/**
* {@inheritdoc}
*/
public function isMultiline(array $element) {
if ($this
->isList($element)) {
return TRUE;
}
else {
return parent::isMultiline($element);
}
}
/**
* Determine if options element is being displayed as list.
*
* @param array $element
* An element.
*
* @return bool
* TRUE if options element is being displayed as ul or ol list.
*/
protected function isList(array $element) {
return $this
->getListType($element) ? TRUE : FALSE;
}
/**
* Get the element's list type.
*
* @param array $element
* An element.
*
* @return string
* List type ul or ol or NULL is element is not formatted as a list.
*/
protected function getListType(array $element) {
$format = $this
->getFormat($element);
switch ($format) {
case 'ol':
case 'ordered':
return 'ol';
case 'ul':
case 'unordered':
case 'list':
return 'ul';
default:
return NULL;
}
}
/**
* {@inheritdoc}
*/
public function getDefaultFormat() {
return 'comma';
}
/**
* {@inheritdoc}
*/
public function getFormats() {
return parent::getFormats() + [
'comma' => $this
->t('Comma'),
'semicolon' => $this
->t('Semicolon'),
'and' => $this
->t('And'),
'ol' => $this
->t('Ordered list'),
'ul' => $this
->t('Unordered list'),
];
}
/**
* {@inheritdoc}
*/
public function getTableColumn(array $element) {
$key = $element['#yamlform_key'];
$columns = parent::getTableColumn($element);
$columns['element__' . $key]['sort'] = !$this
->hasMultipleValues($element);
return $columns;
}
/**
* {@inheritdoc}
*/
public function getExportDefaultOptions() {
return [
'options_format' => 'compact',
'options_item_format' => 'label',
];
}
/**
* {@inheritdoc}
*/
public function buildExportOptionsForm(array &$form, FormStateInterface $form_state, array $export_options) {
if (isset($form['options'])) {
return;
}
$form['options'] = [
'#type' => 'details',
'#title' => $this
->t('Select menu, radio buttons, and checkboxes options'),
'#open' => TRUE,
'#weight' => -10,
];
$form['options']['options_format'] = [
'#type' => 'radios',
'#title' => $this
->t('Options format'),
'#options' => [
'compact' => $this
->t('Compact; with the option values delimited by commas in one column.') . '<div class="description">' . $this
->t('Compact options are more suitable for importing data into other systems.') . '</div>',
'separate' => $this
->t('Separate; with each possible option value in its own column.') . '<div class="description">' . $this
->t('Separate options are more suitable for building reports, graphs, and statistics in a spreadsheet application. Ranking will be included for sortable option elements.') . '</div>',
],
'#default_value' => $export_options['options_format'],
];
$form['options']['options_item_format'] = [
'#type' => 'radios',
'#title' => $this
->t('Options item format'),
'#options' => [
'label' => $this
->t('Option labels, the human-readable value (label)'),
'key' => $this
->t('Option values, the raw value stored in the database (key)'),
],
'#default_value' => $export_options['options_item_format'],
];
}
/**
* {@inheritdoc}
*/
public function buildExportHeader(array $element, array $options) {
if ($options['options_format'] == 'separate' && isset($element['#options'])) {
$header = [];
foreach ($element['#options'] as $option_value => $option_text) {
// Note: If $option_text is an array (typically a tableselect row)
// always use $option_value.
$title = $options['options_item_format'] == 'key' || is_array($option_text) ? $option_value : $option_text;
$header[] = $title;
}
return $this
->prefixExportHeader($header, $element, $options);
}
else {
return parent::buildExportHeader($element, $options);
}
}
/**
* {@inheritdoc}
*/
public function buildExportRecord(array $element, $value, array $export_options) {
$element_options = $element['#options'];
$record = [];
if ($export_options['options_format'] == 'separate') {
// Combine the values so that isset can be used instead of in_array().
// http://stackoverflow.com/questions/13483219/what-is-faster-in-array-or-isset
$deltas = FALSE;
if (is_array($value)) {
$value = array_combine($value, $value);
$deltas = $this->exportDelta ? array_flip(array_values($value)) : FALSE;
}
// Separate multiple values (ie options).
foreach ($element_options as $option_value => $option_text) {
if (is_array($value) && isset($value[$option_value]) || $value == $option_value) {
$record[] = $deltas ? $deltas[$option_value] + 1 : 'X';
}
else {
$record[] = '';
}
}
}
else {
// Handle multiple values with options.
if (is_array($value)) {
if ($export_options['options_item_format'] == 'label') {
$value = YamlFormOptionsHelper::getOptionsText($value, $element_options);
}
$record[] = implode(',', $value);
}
elseif ($export_options['options_item_format'] == 'label') {
$record[] = YamlFormOptionsHelper::getOptionText($value, $element_options);
}
else {
$record[] = $value;
}
}
return $record;
}
/**
* Form API callback. Remove unchecked options from value array.
*/
public static function validateMultipleOptions(array &$element, FormStateInterface $form_state) {
$name = $element['#name'];
$values = $form_state
->getValue($name);
// Filter unchecked/unselected options whose value is 0.
$values = array_filter($values, function ($value) {
return $value !== 0;
});
$values = array_values($values);
$form_state
->setValue($name, $values);
}
/**
* {@inheritdoc}
*/
protected function getElementSelectorInputsOptions(array $element) {
$plugin_id = $this
->getPluginId();
if (preg_match('/yamlform_(select|radios|checkboxes|buttons)_other$/', $plugin_id, $match)) {
$title = $this
->getAdminLabel($element);
list($element_type) = explode(' ', $this
->getPluginLabel());
$inputs = [];
$inputs[$match[1]] = $title . ' [' . $element_type . ']';
$inputs['other'] = $title . ' [' . $this
->t('Text field') . ']';
return $inputs;
}
else {
return [];
}
}
/**
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$form['general']['default_value']['#description'] = $this
->t('The default value of the field identified by its key.');
$form['general']['default_value']['#description'] .= ' ' . $this
->t('For multiple options, use commas to separate multiple defaults.');
// Issue #2836374: Wrapper attributes are not supported by composite
// elements, this includes radios, checkboxes, and buttons.
if (preg_match('/(radios|checkboxes|buttons)/', $this
->getPluginId())) {
$t_args = [
'@name' => Unicode::strtolower($this
->getPluginLabel()),
':href' => 'https://www.drupal.org/node/2836364',
];
$form['element_attributes']['#description'] = $this
->t('Please note: That the below custom element attributes will also be applied to the @name fieldset wrapper. (<a href=":href">Issue #2836374</a>)', $t_args);
}
// Options.
$form['options'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Element options'),
'#open' => TRUE,
];
$form['options']['options'] = [
'#type' => 'yamlform_element_options',
'#title' => $this
->t('Options'),
'#required' => TRUE,
];
$form['options']['options_display'] = [
'#title' => $this
->t('Options display'),
'#type' => 'select',
'#options' => [
'one_column' => $this
->t('One column'),
'two_columns' => $this
->t('Two columns'),
'three_columns' => $this
->t('Three columns'),
'side_by_side' => $this
->t('Side by side'),
],
];
$form['options']['empty_option'] = [
'#type' => 'textfield',
'#title' => $this
->t('Empty option label'),
'#description' => $this
->t('The label to show for the initial option denoting no selection in a select element.'),
];
$form['options']['empty_value'] = [
'#type' => 'textfield',
'#title' => $this
->t('Empty option value'),
'#description' => $this
->t('The value for the initial option denoting no selection in a select element, which is used to determine whether the user submitted a value or not.'),
];
$form['options']['multiple'] = [
'#title' => $this
->t('Multiple'),
'#type' => 'checkbox',
'#return_value' => TRUE,
'#description' => $this
->t('Check this option if the user should be allowed to choose multiple values.'),
];
$form['options']['options_randomize'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Randomize options'),
'#description' => $this
->t('Randomizes the order of the options when they are displayed in the form.'),
'#return_value' => TRUE,
];
// Other.
$states_textfield_or_number = [
'visible' => [
[
':input[name="properties[other__type]"]' => [
'value' => 'textfield',
],
],
'or',
[
':input[name="properties[other__type]"]' => [
'value' => 'number',
],
],
],
];
$states_textarea = [
'visible' => [
':input[name="properties[other__type]"]' => [
'value' => 'textarea',
],
],
];
$states_number = [
'visible' => [
':input[name="properties[other__type]"]' => [
'value' => 'number',
],
],
];
$form['options_other'] = [
'#type' => 'fieldset',
'#title' => $this
->t('Other option settings'),
];
$form['options_other']['other__type'] = [
'#type' => 'select',
'#title' => $this
->t('Other type'),
'#options' => [
'textfield' => $this
->t('Text field'),
'textarea' => $this
->t('Textarea'),
'number' => $this
->t('Number'),
],
];
$form['options_other']['other__option_label'] = [
'#type' => 'textfield',
'#title' => $this
->t('Other option label'),
];
$form['options_other']['other__title'] = [
'#type' => 'textfield',
'#title' => $this
->t('Other title'),
];
$form['options_other']['other__placeholder'] = [
'#type' => 'textfield',
'#title' => $this
->t('Other placeholder'),
];
$form['options_other']['other__description'] = [
'#type' => 'textfield',
'#title' => $this
->t('Other description'),
];
$form['options_other']['other__size'] = [
'#type' => 'number',
'#title' => $this
->t('Other size'),
'#description' => $this
->t('Leaving blank will use the default size.'),
'#min' => 1,
'#size' => 4,
'#states' => $states_textfield_or_number,
];
$form['options_other']['other__maxlength'] = [
'#type' => 'number',
'#title' => $this
->t('Other maxlength'),
'#description' => $this
->t('Leaving blank will use the default maxlength.'),
'#min' => 1,
'#size' => 4,
'#states' => $states_textfield_or_number,
];
$form['options_other']['other__field_prefix'] = [
'#type' => 'textfield',
'#title' => $this
->t('Other field prefix'),
'#description' => $this
->t('Text or code that is placed directly in front of the input. This can be used to prefix an input with a constant string. Examples: $, #, -.'),
'#size' => 10,
'#states' => $states_textfield_or_number,
];
$form['options_other']['other__field_suffix'] = [
'#type' => 'textfield',
'#title' => $this
->t('Other field suffix'),
'#description' => $this
->t('Text or code that is placed directly after the input. This can be used to add a unit to an input. Examples: lb, kg, %.'),
'#size' => 10,
'#states' => $states_textfield_or_number,
];
$form['options_other']['other__rows'] = [
'#type' => 'number',
'#title' => $this
->t('Other rows'),
'#description' => $this
->t('Leaving blank will use the default rows.'),
'#min' => 1,
'#size' => 4,
'#states' => $states_textarea,
];
$form['options_other']['other__min'] = [
'#type' => 'number',
'#title' => $this
->t('Other min'),
'#description' => $this
->t('Specifies the minimum value.'),
'#step' => 'any',
'#size' => 4,
'#states' => $states_number,
];
$form['options_other']['other__max'] = [
'#type' => 'number',
'#title' => $this
->t('Other max'),
'#description' => $this
->t('Specifies the maximum value.'),
'#step' => 'any',
'#size' => 4,
'#states' => $states_number,
];
$form['options_other']['other__step'] = [
'#type' => 'number',
'#title' => $this
->t('Other steps'),
'#description' => $this
->t('Specifies the legal number intervals. Leave blank to support any number interval.'),
'#step' => 'any',
'#size' => 4,
'#states' => $states_number,
];
return $form;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OptionsBase:: |
protected | property | Export delta for multiple options. | 2 |
OptionsBase:: |
public | function |
Build an element's export header. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Get an element's export options form. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Build an element's export row. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Gets the actual configuration form array to be built. Overrides YamlFormElementBase:: |
1 |
OptionsBase:: |
public | function |
Format an element's value as HTML. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Format an element's value as plain text. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Get an element's default format name. Overrides YamlFormElementBase:: |
2 |
OptionsBase:: |
public | function |
Only a few elements don't inherit these default properties. Overrides YamlFormElementBase:: |
8 |
OptionsBase:: |
protected | function |
Get an element's (sub)inputs selectors as options. Overrides YamlFormElementBase:: |
2 |
OptionsBase:: |
public | function |
Get an element's default export options. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Get an element's available formats. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
protected | function | Get the element's list type. | |
OptionsBase:: |
public | function | Get option (option) properties. | |
OptionsBase:: |
public | function |
Get related element types. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Get element's table column(s) settings. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Get translatable properties. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Checks if element value has multiple values. Overrides YamlFormElementBase:: |
2 |
OptionsBase:: |
protected | function | Determine if options element is being displayed as list. | |
OptionsBase:: |
public | function |
Checks if element value could contain multiple lines. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public | function |
Prepare an element to be rendered within a form. Overrides YamlFormElementBase:: |
3 |
OptionsBase:: |
public | function |
Set an element's default value using saved data. Overrides YamlFormElementBase:: |
|
OptionsBase:: |
public static | function | Form API callback. Remove unchecked options from value array. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
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. | |
YamlFormElementBase:: |
protected | property | The configuration factory. | |
YamlFormElementBase:: |
protected | property | The current user. | |
YamlFormElementBase:: |
protected | property | A element info manager. | |
YamlFormElementBase:: |
protected | property | The form element manager. | |
YamlFormElementBase:: |
protected | property | The entity type manager. | |
YamlFormElementBase:: |
protected | property | A logger instance. | |
YamlFormElementBase:: |
protected | property | The token manager. | |
YamlFormElementBase:: |
protected | function | Build an element as text or HTML. | 2 |
YamlFormElementBase:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Build an element as HTML element. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Build an element as text element. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Check element access (rules). Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
YamlFormElementBase:: |
public | function |
Display element disabled warning. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Format an element's table column value. Overrides YamlFormElementInterface:: |
2 |
YamlFormElementBase:: |
public | function |
Get an element's admin label (#admin_title, #title or #yamlform_key). Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get an associative array of element properties from configuration form. Overrides YamlFormElementInterface:: |
2 |
YamlFormElementBase:: |
protected | function | Get configuration property value. | 1 |
YamlFormElementBase:: |
protected | function | Get default base properties used by all elements. | |
YamlFormElementBase:: |
public | function |
Get an element's selectors as options. Overrides YamlFormElementInterface:: |
11 |
YamlFormElementBase:: |
public | function |
Get an element's supported states as options. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get element's format name by looking for '#format' property, global settings, and finally default settings. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Retrieves the default properties for the defined element type. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get an element's key/name. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get an element's label (#title or #yamlform_key). Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get link to element's API documentation. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get the URL for the element's API documentation. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Gets the label of the plugin instance. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Get test value for an element. Overrides YamlFormElementInterface:: |
7 |
YamlFormElementBase:: |
public | function |
Gets the type name (aka id) of the plugin instance with the 'yamlform_' prefix. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Determine if an element supports a specified property. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Checks if the element has a wrapper. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Initialize an element to be displayed, rendered, or exported. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Checks if element is a composite element. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Checks if element is a container that can contain elements. Overrides YamlFormElementInterface:: |
3 |
YamlFormElementBase:: |
public | function |
Checks if element is disabled. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Checks if element is enabled. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Checks if element is hidden. Overrides YamlFormElementInterface:: |
|
YamlFormElementBase:: |
public | function |
Checks if the element carries a value. Overrides YamlFormElementInterface:: |
5 |
YamlFormElementBase:: |
public | function |
Checks if element is a root element. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Acts on a form submission element after it is created. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Delete any additional value associated with an element. Overrides YamlFormElementInterface:: |
2 |
YamlFormElementBase:: |
public | function |
Acts on loaded form submission. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function |
Acts on a saved form submission element before the insert or update hook is invoked. Overrides YamlFormElementInterface:: |
2 |
YamlFormElementBase:: |
public | function |
Changes the values of an entity before it is created. Overrides YamlFormElementInterface:: |
1 |
YamlFormElementBase:: |
public | function | 1 | |
YamlFormElementBase:: |
protected | function | Prefix an element's export header. | |
YamlFormElementBase:: |
protected | function | Set an elements Flexbox and #states wrapper. | 1 |
YamlFormElementBase:: |
public | function |
Acts on a form submission element before the presave hook is invoked. Overrides YamlFormElementInterface:: |
2 |
YamlFormElementBase:: |
protected | function | Set an element's configuration form element default value. | 2 |
YamlFormElementBase:: |
protected | function | Set configuration form default values recursively. | |
YamlFormElementBase:: |
public | function |
Form submission handler. Overrides PluginFormInterface:: |
|
YamlFormElementBase:: |
public | function |
Form validation handler. Overrides PluginFormInterface:: |
3 |
YamlFormElementBase:: |
public static | function | Form API callback. Validate #unique value. | |
YamlFormElementBase:: |
public | function |
Constructs a Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |