IphpFileStoreBundle
IphpFileStoreBundle copied to clipboard
iphp_file not displayed with sonata admin
Hello, I have a problem with iphp_file field. I can't display it in Sonata Admin :
/**
* @ORM\Table(name="produit")
*/
class Produit
{
...
/**
* @var string
*
* @Assert\File( maxSize="20M")
* @FileStore\UploadableField(mapping="image")
* @ORM\Column(type="array",nullable = true)
*/
private $image;
...
}
iphp_file_store:
mappings:
image:
upload_dir: %kernel.root_dir%/../web/files
upload_path: /files
delete_on_remove: true
overwrite_duplicates: true
directory_namer:
property:
params: { field : "produitFolder"}
namer:
translit: ~
property:
params: { field : id}
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->add('image', 'iphp_file')
}

hello, I Have the same problem, some answer?
all my problem solved, adding the annotation
- @FileStore\Uploadable
example:
/**
- Article
- @ORM\Table(name="article", uniqueConstraints={@ORM\UniqueConstraint(name="id", columns={"id"})})
- @ORM\Entity
- @FileStore\Uploadable */