iconRegistry = GeneralUtility::makeInstance(IconRegistry::class); $this->iconFactory = GeneralUtility::makeInstance(IconFactory::class); } /** * @return ResponseInterface * @internal */ public function getCacheIdentifierAction(): ResponseInterface { return new HtmlResponse($this->iconRegistry->getCacheIdentifier()); } /** * @param ServerRequestInterface $request * @return ResponseInterface * @internal */ public function getIconAction(ServerRequestInterface $request): ResponseInterface { $parsedBody = $request->getParsedBody(); $queryParams = $request->getQueryParams(); $requestedIcon = json_decode($parsedBody['icon'] ?? $queryParams['icon'], true); list($identifier, $size, $overlayIdentifier, $iconState, $alternativeMarkupIdentifier) = $requestedIcon; if (empty($overlayIdentifier)) { $overlayIdentifier = null; } $iconState = IconState::cast($iconState); $icon = $this->iconFactory->getIcon($identifier, $size, $overlayIdentifier, $iconState); return new HtmlResponse($icon->render($alternativeMarkupIdentifier)); } }