Hi everyone!

I'm trying the Form component and I was wondering if anyone had a
problem setting a FileField as required. The "NotBlank" constraint
works with my other fields but not with the FileField. I have this
schema:

/**
  * @orm:Column(type="string", length="255")
  * @orm:Validation({
  *   @validation:NotBlank(message="Required Field!"),
  *   @validation:MaxLength(255)
  * })
  */
private $game;

/**
  * @orm:Column(type="string", length="255")
  * @orm:Validation({
  *   @validation:NotBlank(message="Required Field!"),
  *   @validation:File(maxSize="300k", mimeTypes={ "image/jpeg", "image/png" })
  * })
  */
private $link;


And my form:


$form  = new Form( 'game_snapshot', $gameSnapshot, $this[ 'validator' ] );

$form->add( new TextField( 'game' ) );
$form->add( new FileField( 'link' ) );



What am I doing wrong?



Thanks!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to