/** * @param string $presetName name of the preset to use * @return string the rendered form head */ public function render($presetName = 'default') { $content = ''; $presetConfiguration = $this->formBuilderFactory->getPresetConfiguration($presetName); $stylesheets = isset($presetConfiguration['stylesheets']) ? $presetConfiguration['stylesheets'] : []; foreach ($stylesheets as $stylesheet) { $content .= sprintf('<link href="%s" rel="stylesheet">', $this->resourceManager->getPublicPackageResourceUriByPath($stylesheet['source'])); } $javaScripts = isset($presetConfiguration['javaScripts']) ? $presetConfiguration['javaScripts'] : []; foreach ($javaScripts as $javaScript) { $content .= sprintf('<script src="%s"></script>', $this->resourceManager->getPublicPackageResourceUriByPath($javaScript['source'])); } return $content; }