logo
Ask your Symfony questions! Pay money and get answers fast! (more info)

This is an old version of this answer!

Return to the current answer
$this->validatorSchema['image'] = new sfValidatorFile(array(
'path' => sfConfig::get('sf_web_dir') .'/images/XXX/',
'required' => false,
));

$this->validatorSchema['image_delete'] = new sfValidatorPass();


$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
'file_src' => '/images/XXX/'.$this->getObject()->getImage(),
'is_image' => true,
'edit_mode' => !$this->isNew(),
'template' => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>',
))

Jimish Gamit | 09/23/11 at 9:30am

This is an old version of this answer!

Return to the current answer