cObj->stdWrapValue('renderMode', $conf);
if ($renderMode === 'inline') {
return $this->renderInline($conf);
}
return $this->renderObject($conf);
}
protected function renderInline(array $conf): string
{
$resource = $this->resolveResource($conf);
[$width, $height, $isDefaultWidth, $isDefaultHeight] = $this->getDimensions($conf);
$content = $svgContent = '';
if ($resource instanceof SystemResourceInterface) {
try {
$svgContent = $resource->getContents();
} catch (SystemResourceDoesNotExistException) {
}
}
if ($svgContent !== '') {
try {
$document = $this->svgDocumentFactory->fromStringAndSanitize($svgContent);
if (!$isDefaultWidth) {
$document->documentElement->setAttribute('width', (string)$width);
}
if (!$isDefaultHeight) {
$document->documentElement->setAttribute('height', (string)$height);
}
$content = $this->svgDocumentService->toInlineMarkup($document);
} catch (InvalidSvgException) {
$content = '';
}
} else {
$value = $this->cObj->stdWrapValue('value', $conf);
if (!empty($value)) {
$content = [];
$content[] = '';
$content = implode(LF, $content);
}
}
if (isset($conf['stdWrap.'])) {
$content = $this->cObj->stdWrap($content, $conf['stdWrap.']);
}
return $content;
}
/**
* Render the SVG as