I need to override my form like this:
protected function doSave($con = null)
{
$filename= Helper::generateFilename($this->getValue('name')).'jpg';
imagejpeg(Helper::createImage($this->getValues()), sfConfig::get('sf_upload_dir').'/poster/'.$filename );
/* Here I need to set value of *fielname* field of the form equal to
$filename */
parent::doSave($con);
}
Helper.class.php is located in /lib/so it acts like a helper class.
generateFilename actually gives a randomized string. since there is no function like setValue in a form, I’m stuck.
You have to use, say you have used
filenameas field in your schema to store the image filename,$this->object->setFilename($filename);beforeparent::doSave($con);