protected function WebformDevelEntityFormApiBaseForm::wrapTranslatableValue in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_devel/src/Form/WebformDevelEntityFormApiBaseForm.php \Drupal\webform_devel\Form\WebformDevelEntityFormApiBaseForm::wrapTranslatableValue()
Wrap translatable value in <T> tags.
Parameters
mixed $value: A translatable value.
Return value
array|string A translatable value in <T> tags.
1 call to WebformDevelEntityFormApiBaseForm::wrapTranslatableValue()
- WebformDevelEntityFormApiBaseForm::renderExport in modules/
webform_devel/ src/ Form/ WebformDevelEntityFormApiBaseForm.php - Export a PHP render array.
File
- modules/
webform_devel/ src/ Form/ WebformDevelEntityFormApiBaseForm.php, line 174
Class
- WebformDevelEntityFormApiBaseForm
- Export a webform's element to Form API (FAPI).
Namespace
Drupal\webform_devel\FormCode
protected function wrapTranslatableValue($value) {
if (is_array($value)) {
foreach ($value as $key => $item) {
$value[$key] = $this
->wrapTranslatableValue($item);
}
return $value;
}
else {
return '<T>' . $value . '</T>';
}
}