I need to customize a form view field (edit form field) in EasyAdmin bundle. Here's how it's done in the list view:
- { property: 'images', template: 'custom_template.html.twig'}
How to implement the same thing in the form view (edit mode)? Custom templates don't work for the form view (edit view). So I made a custom field type
- { property: 'images', type: 'App\Form\Type\MyImagesType'}
but don't know how to implement a custom template to it.
class MyImagesType extends CollectionType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$form->add($key, FileType::class, ['multiple'=>true, 'required'=>false]);
}
}
I want to integrate dopzone.js in my form by inserting the script:
<script src="./public/dropzone.js"></script>
<form action="{{ oneup_uploader_endpoint('gallery') }}" class="dropzone" style="width:200px; height:200px; border:4px dashed black">
</form>