Skip to content

Latest commit

 

History

History
30 lines (27 loc) · 608 Bytes

README.md

File metadata and controls

30 lines (27 loc) · 608 Bytes

SvD Media Bundle

Configuration

svd_media:
    adapter:                            gaufrette_service_id
    base_url:                           file_folder_url

Usage

Add ralation to your entity annotation.

/**
* @OneToOne(targetEntity="File")
* @JoinColumn(name="file_id", referencedColumnName="id")
**/
protected $file; 

To form type add media field

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder->add('file', MediaType::class)
}

To remove unused media from storage, run command:

app/console media:remove-unused