コード例 #1
0
ファイル: RenderHeadViewHelper.php プロジェクト: neos/form
 /**
  * @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;
 }
コード例 #2
0
 public function build(array $configuration, $presetName)
 {
     $configuration = array('type' => 'Neos.Form:Form', 'identifier' => 'testing', 'label' => 'My Label', 'renderables' => array(array('type' => 'Neos.Form:Page', 'identifier' => 'general', 'renderables' => array(array('type' => 'Neos.Form:TestingFormElementWithSubElements', 'identifier' => 'subel')))));
     return parent::build($configuration, $presetName);
 }