Posted By

ef on 02/07/11


Tagged

sfWidgetFormInputFileEditable


Versions (?)

Example of using sfWidgetFormInputFileEditable to add images in Symfony 1.4


 / Published in: Symfony
 

Example provides working solution to uploading and editing files in Symfony.

  1. $logoPicFileSrc = '/uploads/'.$this->getObject()->partner_logo_pic;
  2. $this->widgetSchema['logo_pic'] = new sfWidgetFormInputFileEditable(array('file_src' => logoPicFileSrc,
  3. 'is_image' => true,
  4. 'edit_mode' => !$this->isNew(),
  5. 'delete_label' => 'Usu� obrazek'));
  6.  
  7. $this->validatorSchema['logo_pic'] = new sfValidatorFile(array(
  8. 'mime_types' => 'web_images',
  9. 'path' => sfConfig::get('sf_upload_dir'),
  10. 'required' => false));
  11. $this->validatorSchema['logo_pic_delete'] = new sfValidatorBoolean();

Report this snippet  

You need to login to post a comment.