/ Published in: Symfony
Example provides working solution to uploading and editing files in Symfony.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$logoPicFileSrc = '/uploads/'.$this->getObject()->partner_logo_pic; $this->widgetSchema['logo_pic'] = new sfWidgetFormInputFileEditable(array('file_src' => logoPicFileSrc, 'is_image' => true, 'edit_mode' => !$this->isNew(), 'delete_label' => 'Usu� obrazek')); $this->validatorSchema['logo_pic'] = new sfValidatorFile(array( 'mime_types' => 'web_images', 'path' => sfConfig::get('sf_upload_dir'), 'required' => false)); $this->validatorSchema['logo_pic_delete'] = new sfValidatorBoolean();