Skip to content

Instantly share code, notes, and snippets.

@anveo
Created January 14, 2009 19:14
Show Gist options
  • Save anveo/47006 to your computer and use it in GitHub Desktop.
Save anveo/47006 to your computer and use it in GitHub Desktop.
protected function processForm(sfWebRequest $request, sfForm $form)
{
$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
if ($form->isValid())
{
$file = $form->getValue('file');
if($file)
{
$ad->setMimeType($form->getValue('file')->getType());
}
$ad = $form->save();
$this->redirect('ads/edit?id='.$ad->getId());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment