WebformTable.php in Webform 8.5
File
src/Element/WebformTable.php
View source
<?php
namespace Drupal\webform\Element;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Render\Element\Table;
class WebformTable extends Table {
public function getInfo() {
return parent::getInfo() + [
'#theme_wrappers' => [
'form_element',
],
];
}
public static function processTable(&$element, FormStateInterface $form_state, &$complete_form) {
$element['#input'] = TRUE;
$element['#tableselect'] = FALSE;
$element['#tabledrag'] = FALSE;
$element['#tree'] = FALSE;
$element['#attributes']['class'][] = 'webform-table';
$element['#label_attributes']['webform-remove-for-attribute'] = TRUE;
$element['#attached']['library'][] = 'webform/webform.element.table';
return $element;
}
}