Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iphp_file not displayed with sonata admin #46

Open
soufiene-aissa opened this issue May 3, 2016 · 2 comments
Open

iphp_file not displayed with sonata admin #46

soufiene-aissa opened this issue May 3, 2016 · 2 comments

Comments

@soufiene-aissa
Copy link

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')
}

screenshot-web dev 2016-05-03 13-19-27

@wladimiravila
Copy link

hello, I Have the same problem, some answer?

@wladimiravila
Copy link

all my problem solved, adding the annotation

example:

/**

  • Article
  • @Orm\Table(name="article", uniqueConstraints={@Orm\UniqueConstraint(name="id", columns={"id"})})
  • @Orm\Entity
  • @FileStore\Uploadable
    */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants