Hi,
I have an schema like this:
banner:
id: ~
ordem: { type: integer, required: true }
imagem: { type: varchar(255), required: true }
link: { type: varchar(255), required: false }
When i edit an record in admin module i get an error Required for imagem
field.
Thats the code in BannerForm.class.php
parent::configure();
$this->widgetSchema['imagem'] = new sfWidgetFormInputFileEditable(array(
'label' => 'Imagem 630x288',
'file_src' => '/uploads/banner/'.$this->getObject()->getImagem(),
'is_image' => true,
'edit_mode' => !$this->isNew(),
'delete_label' => 'Remover imagem',
'template' => '<div>%file%<br />%input%<br />%delete%
%delete_label%</div>',
));
/*
$this->widgetSchema['imagem'] = new sfWidgetFormInputFile(array(
'label' => 'Imagem 630x288',
));
*/
$this->validatorSchema['imagem'] = new sfValidatorFile(array(
'required' => true,
'path' => sfConfig::get('sf_upload_dir').'/banner',
'mime_types' => 'web_images',
));
$this->validatorSchema['imagem_delete'] = new sfValidatorBoolean();
What an my doing wrong here? this code i get from symfony docs.
Thank You
Celso
--
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.