WebformSubmissionInformation.php in Webform 8.5
File
src/Element/WebformSubmissionInformation.php
View source
<?php
namespace Drupal\webform\Element;
use Drupal\Core\Render\Element\RenderElement;
class WebformSubmissionInformation extends RenderElement {
public function getInfo() {
$class = get_class($this);
return [
'#theme' => 'webform_submission_information',
'#webform_submission' => NULL,
'#source_entity' => NULL,
'#pre_render' => [
[
$class,
'preRenderWebformSubmissionInformation',
],
],
'#theme_wrappers' => [
'details',
],
'#summary_attributes' => [],
];
}
public static function preRenderWebformSubmissionInformation(array $element) {
$webform_submission = $element['#webform_submission'];
$webform = $webform_submission
->getWebform();
$element += [
'#title' => t('Submission information'),
];
$element['#attributes']['data-webform-element-id'] = $webform
->id() . '-submission-information';
$element['#attributes']['class'] = [
'webform-submission-information',
];
return $element;
}
}