setProperty($propertyName) ->setLabel($label) ->setTemplatePath('@LcSov/tabler/crud/field/collection.html.twig') ->setFormType(CollectionType::class) ->addCssClass('field-collection') ->addWebpackEncoreEntries('field-collection') ->addWebpackEncoreEntries('field-filemanager') ->setFormTypeOption('allow_add', true) ->setFormTypeOption('allow_delete', true) ->setFormTypeOption('entry_options', array('label'=> false)) ->setFormTypeOption('entry_type', FileManagerType::class) ->setFormTypeOption('attr', array('class'=> 'field-collection-group')) ->setFormTypeOption('row_attr', array('data-sortable'=> true)) ->hideOnIndex(); //->setEntryType(FileManagerType::class); //->setFormTypeOption('show_entry_label', false); } public function allowAdd(bool $allow = true): self { $this->setCustomOption(self::OPTION_ALLOW_ADD, $allow); return $this; } public function allowDelete(bool $allow = true): self { $this->setCustomOption(self::OPTION_ALLOW_DELETE, $allow); return $this; } /** * Set this option to TRUE if the collection items are complex form types * composed of several form fields (EasyAdmin applies a special rendering to make them look better). */ public function setEntryIsComplex(bool $isComplex): self { $this->setCustomOption(self::OPTION_ENTRY_IS_COMPLEX, $isComplex); return $this; } public function setEntryType(string $formTypeFqcn): self { $this->setCustomOption(self::OPTION_ENTRY_TYPE, $formTypeFqcn); return $this; } public function showEntryLabel(bool $showLabel = true): self { $this->setCustomOption(self::OPTION_SHOW_ENTRY_LABEL, $showLabel); return $this; } }