protected function WebformLink::formatTextItemValue in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformLink.php \Drupal\webform\Plugin\WebformElement\WebformLink::formatTextItemValue()
Format composite element value into lines of text.
Parameters
array $element: An element.
\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.
array $options: An array of options.
Return value
array Composite element values converted into lines of text.
Overrides WebformCompositeBase::formatTextItemValue
File
- src/
Plugin/ WebformElement/ WebformLink.php, line 55
Class
- WebformLink
- Provides a 'link' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
protected function formatTextItemValue(array $element, WebformSubmissionInterface $webform_submission, array $options = []) {
$value = $this
->getValue($element, $webform_submission, $options);
return [
'link' => new FormattableMarkup('@title (@url)', [
'@title' => $value['title'],
'@url' => $value['url'],
]),
];
}