public function WebformManagedFileBase::previewManagedFile in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformManagedFileBase.php \Drupal\webform\Plugin\WebformElement\WebformManagedFileBase::previewManagedFile()
Preview a managed file element upload.
Parameters
array $element: An element.
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
array $options: An array of options.
Return value
string|array A preview.
File
- src/
Plugin/ WebformElement/ WebformManagedFileBase.php, line 908
Class
- WebformManagedFileBase
- Provides a base class webform 'managed_file' elements.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function previewManagedFile(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
$build = $this
->formatHtmlItem($element, $webform_submission, $options);
return is_array($build) ? $build : [
'#markup' => $build,
];
}