public function InsertImageWidgetUtility::render in Insert 8
@inheritdoc
Overrides InsertFileWidgetUtility::render
File
- src/
Utility/ InsertImageWidgetUtility.php, line 192
Class
Namespace
Drupal\insert\UtilityCode
public function render($styleName, $vars) {
if ($styleName == 'icon_link') {
$rendered = \Drupal::theme()
->render([
'insert_icon_link',
], $vars);
}
elseif ($styleName === 'link') {
$rendered = \Drupal::theme()
->render([
'insert_link',
], $vars);
}
else {
$rendered = \Drupal::theme()
->render([
'insert_image__' . str_replace('-', '_', $styleName),
'insert_image',
], $vars);
}
return gettype($rendered) === 'string' ? $rendered : $rendered
->jsonSerialize();
}