abstract class YamlFormCompositeBase in YAML Form 8
Same name in this branch
- 8 src/Element/YamlFormCompositeBase.php \Drupal\yamlform\Element\YamlFormCompositeBase
- 8 src/Plugin/YamlFormElement/YamlFormCompositeBase.php \Drupal\yamlform\Plugin\YamlFormElement\YamlFormCompositeBase
Provides a base for composite elements.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\yamlform\YamlFormElementBase implements YamlFormElementInterface uses StringTranslationTrait
- class \Drupal\yamlform\Plugin\YamlFormElement\YamlFormCompositeBase
- class \Drupal\yamlform\YamlFormElementBase implements YamlFormElementInterface uses StringTranslationTrait
Expanded class hierarchy of YamlFormCompositeBase
File
- src/
Plugin/ YamlFormElement/ YamlFormCompositeBase.php, line 18
Namespace
Drupal\yamlform\Plugin\YamlFormElementView source
abstract class YamlFormCompositeBase extends YamlFormElementBase {
/**
* {@inheritdoc}
*/
public function getRelatedTypes(array $element) {
return [];
}
/**
* Get composite elements.
*
* @return array
* An array of composite elements.
*/
protected abstract function getCompositeElements();
/**
* Get initialized composite element.
*
* @param array &$element
* A composite element.
*
* @return array
* The initialized composite test element.
*/
protected abstract function getInitializedCompositeElement(array &$element);
/**
* {@inheritdoc}
*/
public function prepare(array &$element, YamlFormSubmissionInterface $yamlform_submission) {
parent::prepare($element, $yamlform_submission);
// If #flexbox is not set or an empty string, determine if the
// form is using a flexbox layout.
if (!isset($element['#flexbox']) || $element['#flexbox'] === '') {
$yamlform = $yamlform_submission
->getYamlForm();
$element['#flexbox'] = $yamlform
->hasFlexboxLayout();
}
}
/**
* Format composite element value into lines of text.
*
* @param array $element
* A composite element.
* @param array $value
* Composite element values.
*
* @return array
* Composite element values converted into lines of text.
*/
protected function formatLines(array $element, array $value) {
$items = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
if (isset($value[$composite_key]) && $value[$composite_key] != '') {
$composite_element = $composite_elements[$composite_key];
$composite_title = $composite_element['#title'];
$composite_value = $value[$composite_key];
$items[$composite_key] = "<b>{$composite_title}:</b> {$composite_value}";
}
}
return $items;
}
/**
* {@inheritdoc}
*/
public function getDefaultProperties() {
$properties = [
'title' => '',
// General settings.
'description' => '',
'default_value' => [],
// Form display.
'title_display' => 'invisible',
'description_display' => '',
// Form validation.
'required' => FALSE,
// Flex box.
'flexbox' => '',
] + $this
->getDefaultBaseProperties();
$composite_elements = $this
->getCompositeElements();
foreach ($composite_elements as $composite_key => $composite_element) {
// Get #type, #title, and #option from composite elements.
foreach ($composite_element as $composite_property_key => $composite_property_value) {
if (in_array($composite_property_key, [
'#type',
'#title',
'#options',
])) {
$property_key = str_replace('#', $composite_key . '__', $composite_property_key);
if ($composite_property_value instanceof TranslatableMarkup) {
$properties[$property_key] = (string) $composite_property_value;
}
else {
$properties[$property_key] = $composite_property_value;
}
}
}
if (isset($properties[$composite_key . '__type'])) {
$properties['default_value'][$composite_key] = '';
$properties[$composite_key . '__description'] = FALSE;
$properties[$composite_key . '__required'] = FALSE;
$properties[$composite_key . '__placeholder'] = '';
}
$properties[$composite_key . '__access'] = TRUE;
}
return $properties;
}
/**
* {@inheritdoc}
*/
public function getTableColumn(array $element) {
$key = $element['#yamlform_key'];
$title = $element['#title'] ?: $key;
$is_title_displayed = YamlFormElementHelper::isTitleDisplayed($element);
// Get the main composite element, which can't be sorted.
$columns = parent::getTableColumn($element);
$columns['element__' . $key]['sort'] = FALSE;
// Get individual composite elements.
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_element = $composite_elements[$composite_key];
// Make sure the composite element is visible.
$access_key = '#' . $composite_key . '__access';
if (isset($element[$access_key]) && $element[$access_key] === FALSE) {
continue;
}
// Add reference to initialized composite element so that it can be
// used by ::formatTableColumn().
$columns['element__' . $key . '__' . $composite_key] = [
'title' => ($is_title_displayed ? $title . ': ' : '') . (!empty($composite_element['#title']) ? $composite_element['#title'] : $composite_key),
'sort' => TRUE,
'default' => FALSE,
'key' => $key,
'element' => $element,
'property_name' => $composite_key,
'composite_key' => $composite_key,
'composite_element' => $composite_element,
'plugin' => $this,
];
}
return $columns;
}
/**
* {@inheritdoc}
*/
public function formatTableColumn(array $element, $value, array $options = []) {
if (isset($options['composite_key']) && isset($options['composite_element'])) {
$composite_key = $options['composite_key'];
$composite_element = $options['composite_element'];
$composite_value = $value[$composite_key];
$composite_options = [];
return $this->elementManager
->invokeMethod('formatHtml', $composite_element, $composite_value, $composite_options);
}
else {
return $this
->formatHtml($element, $value);
}
}
/**
* {@inheritdoc}
*/
public function getElementSelectorOptions(array $element) {
$title = $this
->getAdminLabel($element) . ' [' . $this
->getPluginLabel() . ']';
$name = $element['#yamlform_key'];
$selectors = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach ($composite_elements as $composite_key => $composite_element) {
$has_access = !isset($composite_elements['#access']) || $composite_elements['#access'];
if ($has_access && isset($composite_element['#type'])) {
$element_handler = $this->elementManager
->getElementInstance($composite_element);
$composite_title = isset($composite_element['#title']) ? $composite_element['#title'] : $composite_key;
switch ($composite_element['#type']) {
case 'label':
case 'yamlform_message':
break;
case 'yamlform_select_other':
$selectors[":input[name=\"{$name}[{$composite_key}][select]\"]"] = $composite_title . ' [' . $this
->t('Select') . ']';
$selectors[":input[name=\"{$name}[{$composite_key}][other]\"]"] = $composite_title . ' [' . $this
->t('Textfield') . ']';
break;
default:
$selectors[":input[name=\"{$name}[{$composite_key}]\"]"] = $composite_title . ' [' . $element_handler
->getPluginLabel() . ']';
break;
}
}
}
return [
$title => $selectors,
];
}
/**
* {@inheritdoc}
*/
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
// Update #default_value description.
$form['general']['default_value']['#description'] = $this
->t("The default value of the composite form element as YAML.");
// Update #required label.
$form['validation']['required']['#description'] .= '<br/>' . $this
->t("Checking this option only displays the required indicator next to this element's label. Please chose which elements should be required below.");
$form['composite'] = [
'#type' => 'fieldset',
'#title' => $this
->t('@title settings', [
'@title' => $this
->getPluginLabel(),
]),
];
$form['composite']['elements'] = $this
->buildCompositeElementsTable();
$form['composite']['flexbox'] = [
'#type' => 'select',
'#title' => $this
->t('Use Flexbox'),
'#description' => $this
->t("If 'Automatic' is selected Flexbox layout will only be used if a Flexbox element is included in the form."),
'#options' => [
'' => $this
->t('Automatic'),
0 => $this
->t('No'),
1 => $this
->t('Yes'),
],
];
return $form;
}
/**
* Build the composite elements settings table.
*
* @return array
* A renderable array container the composite elements settings table.
*/
protected function buildCompositeElementsTable() {
$header = [
$this
->t('Key'),
$this
->t('Title/Description/Placeholder'),
$this
->t('Type/Options'),
$this
->t('Required'),
$this
->t('Visible'),
];
$rows = [];
$composite_elements = $this
->getCompositeElements();
foreach ($composite_elements as $composite_key => $composite_element) {
$title = isset($composite_element['#title']) ? $composite_element['#title'] : $composite_key;
$type = isset($composite_element['#type']) ? $composite_element['#type'] : NULL;
$t_args = [
'@title' => $title,
];
$attributes = [
'style' => 'width: 100%; margin-bottom: 5px',
];
$state_disabled = [
'disabled' => [
':input[name="properties[' . $composite_key . '__access]"]' => [
'checked' => FALSE,
],
],
];
$row = [];
// Key.
$row[$composite_key . '__key'] = [
'#markup' => $composite_key,
'#access' => TRUE,
];
// Title, placeholder, and description.
if ($type) {
$row['title_and_description'] = [
'data' => [
$composite_key . '__title' => [
'#type' => 'textfield',
'#title' => $this
->t('@title title', $t_args),
'#title_display' => 'invisible',
'#placeholder' => $this
->t('Enter title...'),
'#attributes' => $attributes,
'#states' => $state_disabled,
],
$composite_key . '__placeholder' => [
'#type' => 'textfield',
'#title' => $this
->t('@title placeholder', $t_args),
'#title_display' => 'invisible',
'#placeholder' => $this
->t('Enter placeholder...'),
'#attributes' => $attributes,
'#states' => $state_disabled,
],
$composite_key . '__description' => [
'#type' => 'textarea',
'#title' => $this
->t('@title description', $t_args),
'#title_display' => 'invisible',
'#rows' => 2,
'#placeholder' => $this
->t('Enter description...'),
'#attributes' => $attributes,
'#states' => $state_disabled,
],
],
];
}
else {
$row['title_and_description'] = [
'data' => [
'',
],
];
}
// Type and options.
// Using if/else instead of switch/case because of complex conditions.
$row['type_and_options'] = [];
if ($type == 'tel') {
$row['type_and_options']['data'][$composite_key . '__type'] = [
'#type' => 'select',
'#required' => TRUE,
'#options' => [
'tel' => $this
->t('Telephone'),
'textfield' => $this
->t('Text field'),
],
'#attributes' => [
'style' => 'width: 100%; margin-bottom: 5px',
],
'#states' => $state_disabled,
];
}
elseif ($type == 'select' && ($composite_options = $this
->getCompositeElementOptions($composite_key))) {
$row['type_and_options']['data'][$composite_key . '__type'] = [
'#type' => 'select',
'#required' => TRUE,
'#options' => [
'select' => $this
->t('Select'),
'yamlform_select_other' => $this
->t('Select other'),
'textfield' => $this
->t('Text field'),
],
'#attributes' => [
'style' => 'width: 100%; margin-bottom: 5px',
],
'#states' => $state_disabled,
];
$row['type_and_options']['data'][$composite_key . '__options'] = [
'#type' => 'select',
'#options' => $composite_options,
'#required' => TRUE,
'#attributes' => [
'style' => 'width: 100%;',
],
'#states' => $state_disabled + [
'invisible' => [
':input[name="properties[' . $composite_key . '__type]"]' => [
'value' => 'textfield',
],
],
],
];
}
else {
$row['type_and_options']['data'][$composite_key . '__type'] = [
'#type' => 'textfield',
'#access' => FALSE,
];
$row['type_and_options']['data']['markup'] = [
'#markup' => $this->elementManager
->getElementInstance($composite_element)
->getPluginLabel(),
'#access' => TRUE,
];
}
// Required.
if ($type) {
$row[$composite_key . '__required'] = [
'#type' => 'checkbox',
'#return_value' => TRUE,
];
}
else {
$row[$composite_key . '__required'] = [
'data' => [
'',
],
];
}
// Access.
$row[$composite_key . '__access'] = [
'#type' => 'checkbox',
'#return_value' => TRUE,
];
$rows[$composite_key] = $row;
}
return [
'#type' => 'table',
'#header' => $header,
] + $rows;
}
/**
* {@inheritdoc}
*/
public function isMultiline(array $element) {
return TRUE;
}
/**
* {@inheritdoc}
*/
public function formatHtml(array &$element, $value, array $options = []) {
// Return empty value.
if (empty($value) || empty(array_filter($value))) {
return '';
}
$format = $this
->getFormat($element);
switch ($format) {
case 'list':
$items = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_element = $composite_elements[$composite_key];
$composite_title = isset($composite_element['#title']) ? $composite_element['#title'] : $composite_key;
$composite_value = isset($value[$composite_key]) ? $value[$composite_key] : '';
if ($composite_value !== '') {
$items[$composite_key] = [
'#markup' => "<b>{$composite_title}:</b> {$composite_value}",
];
}
}
return [
'#theme' => 'item_list',
'#items' => $items,
];
case 'raw':
$items = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_value = isset($value[$composite_key]) ? $value[$composite_key] : '';
if ($composite_value !== '') {
$items[$composite_key] = [
'#markup' => "<b>{$composite_key}:</b> {$composite_value}",
];
}
}
return [
'#theme' => 'item_list',
'#items' => $items,
];
default:
$lines = $this
->formatLines($element, $value);
foreach ($lines as $key => $line) {
if ($key == 'email') {
$lines[$key] = [
'#type' => 'link',
'#title' => $line,
'#url' => \Drupal::pathValidator()
->getUrlIfValid('mailto:' . $line),
];
}
else {
$lines[$key] = [
'#markup' => $line,
];
}
$lines[$key]['#suffix'] = '<br/>';
}
return $lines;
}
}
/**
* {@inheritdoc}
*/
public function getFormats() {
return parent::getFormats() + [
'list' => $this
->t('List'),
];
}
/**
* {@inheritdoc}
*/
public function formatText(array &$element, $value, array $options = []) {
// Return empty value.
if (empty($value) || is_array($value) && empty(array_filter($value))) {
return '';
}
$format = $this
->getFormat($element);
switch ($format) {
case 'list':
$items = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_element = $composite_elements[$composite_key];
$composite_title = $composite_element['#title'];
$composite_value = $value[$composite_key];
if ($composite_value !== '') {
$items[$composite_key] = "{$composite_title}: {$composite_value}";
}
}
return implode("\n", $items);
case 'raw':
$items = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_value = $value[$composite_key];
if ($composite_value !== '') {
$items[$composite_key] = "{$composite_key}: {$composite_value}";
}
}
return implode("\n", $items);
default:
$lines = $this
->formatLines($element, $value);
return implode("\n", $lines);
}
}
/**
* {@inheritdoc}
*/
public function getExportDefaultOptions() {
return [
'composite_element_item_format' => 'label',
];
}
/**
* {@inheritdoc}
*/
public function buildExportOptionsForm(array &$form, FormStateInterface $form_state, array $export_options) {
$form['composite'] = [
'#type' => 'details',
'#title' => $this
->t('Composite element'),
'#open' => TRUE,
'#weight' => -10,
];
$form['composite']['composite_element_item_format'] = [
'#type' => 'radios',
'#title' => $this
->t('Composite element 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['composite_element_item_format'],
];
}
/**
* {@inheritdoc}
*/
public function buildExportHeader(array $element, array $options) {
$composite_elements = $this
->getInitializedCompositeElement($element);
$header = [];
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_element = $composite_elements[$composite_key];
if (isset($composite_element['#access']) && $composite_element['#access'] === FALSE) {
continue;
}
if ($options['header_format'] == 'label' && !empty($composite_element['#title'])) {
$header[] = $composite_element['#title'];
}
else {
$header[] = $composite_key;
}
}
return $this
->prefixExportHeader($header, $element, $options);
}
/**
* {@inheritdoc}
*/
public function buildExportRecord(array $element, $value, array $export_options) {
$record = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$composite_element = $composite_elements[$composite_key];
if (isset($composite_element['#access']) && $composite_element['#access'] === FALSE) {
continue;
}
if ($export_options['composite_element_item_format'] == 'label' && $composite_element['#type'] != 'textfield' && !empty($composite_element['#options'])) {
$record[] = YamlFormOptionsHelper::getOptionText($value[$composite_key], $composite_element['#options']);
}
else {
$record[] = isset($value[$composite_key]) ? $value[$composite_key] : NULL;
}
}
return $record;
}
/**
* {@inheritdoc}
*/
public function getTestValue(array $element, YamlFormInterface $yamlform) {
/** @var \Drupal\yamlform\YamlFormSubmissionGenerateInterface $generate */
$generate = \Drupal::service('yamlform_submission.generate');
$value = [];
$composite_elements = $this
->getInitializedCompositeElement($element);
foreach (RenderElement::children($composite_elements) as $composite_key) {
$value[$composite_key] = $generate
->getTestValue($yamlform, $composite_key, $composite_elements[$composite_key]);
}
return [
$value,
];
}
/**
* {@inheritdoc}
*/
public function getConfigurationFormProperties(array &$form, FormStateInterface $form_state) {
$properties = parent::getConfigurationFormProperties($form, $form_state);
foreach ($properties as $key => $value) {
// Convert composite element access and required to boolean value.
if (strpos($key, '__access') || strpos($key, '__required')) {
$properties[$key] = (bool) $value;
}
// If the entire element is required remove required property for
// composite elements.
if (!empty($properties['required']) && strpos($key, '__required')) {
unset($properties[$key]);
}
}
return $properties;
}
/**
* Get form option keys for composite element based on the composite element's key.
*
* @param string $composite_key
* A composite element's key.
*
* @return array
* An array form options.
*/
protected function getCompositeElementOptions($composite_key) {
/** @var \Drupal\yamlform\YamlFormOptionsInterface[] $yamlform_options */
$yamlform_options = YamlFormOptions::loadMultiple();
$options = [];
foreach ($yamlform_options as $key => $yamlform_option) {
if (strpos($key, $composite_key) === 0) {
$options[$key] = $yamlform_option
->label();
}
}
return $options;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. | |
YamlFormCompositeBase:: |
protected | function | Build the composite elements settings table. | 1 |
YamlFormCompositeBase:: |
public | function |
Build an element's export header. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Get an element's export options form. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Build an element's export row. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Gets the actual configuration form array to be built. Overrides YamlFormElementBase:: |
1 |
YamlFormCompositeBase:: |
public | function |
Format an element's value as HTML. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
protected | function | Format composite element value into lines of text. | 2 |
YamlFormCompositeBase:: |
public | function |
Format an element's table column value. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Format an element's value as plain text. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
protected | function | Get form option keys for composite element based on the composite element's key. | |
YamlFormCompositeBase:: |
abstract protected | function | Get composite elements. | |
YamlFormCompositeBase:: |
public | function |
Get an associative array of element properties from configuration form. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Only a few elements don't inherit these default properties. Overrides YamlFormElementBase:: |
2 |
YamlFormCompositeBase:: |
public | function |
Get an element's selectors as options. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Get an element's default export options. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Get an element's available formats. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
abstract protected | function | Get initialized composite element. | 4 |
YamlFormCompositeBase:: |
public | function |
Get related element types. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Get element's table column(s) settings. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Get test value for an element. Overrides YamlFormElementBase:: |
1 |
YamlFormCompositeBase:: |
public | function |
Checks if element value could contain multiple lines. Overrides YamlFormElementBase:: |
|
YamlFormCompositeBase:: |
public | function |
Prepare an element to be rendered within a form. Overrides YamlFormElementBase:: |
1 |
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 |
Get an element's admin label (#admin_title, #title or #yamlform_key). Overrides YamlFormElementInterface:: |
|
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 default format name. Overrides YamlFormElementInterface:: |
17 |
YamlFormElementBase:: |
protected | function | Get an element's (sub)inputs selectors as options. | 7 |
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 translatable properties. 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 |
Checks if element value has multiple values. Overrides YamlFormElementInterface:: |
3 |
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 |
Set an element's default value using saved data. Overrides YamlFormElementInterface:: |
8 |
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:: |