Skip to content

Instantly share code, notes, and snippets.

@caefer
Created August 19, 2010 11:50
Show Gist options
  • Save caefer/537682 to your computer and use it in GitHub Desktop.
Save caefer/537682 to your computer and use it in GitHub Desktop.
<?php
/**
* BarfooArticle form.
*
* @package integration
* @subpackage form
* @author caefer <caefer@ical.ly>
* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class BarfooArticleForm extends BaseBarfooArticleForm
{
public function configure()
{
$this->widgetSchema['topImage'] = new sfWidgetFormInputFileEditable(array(
'label' => 'Image',
'is_image' => true,
'file_src' => '/uploads/barfooarticle/'.$this->getObject()->topImage
));
$this->validatorSchema['topImage'] = new sfValidatorFile(array(
'required' => false,
'path' => sfConfig::get('sf_upload_dir').'/barfooarticle',
'mime_types' => 'web_images',
));
$this->validatorSchema['topImage_delete'] = new sfValidatorPass();
$this->widgetSchema['centerImage'] = new sfWidgetFormInputFileEditable(array(
'label' => 'Image',
'is_image' => true,
'file_src' => '/uploads/barfooarticle/'.$this->getObject()->centerImage
));
$this->validatorSchema['centerImage'] = new sfValidatorFile(array(
'required' => false,
'path' => sfConfig::get('sf_upload_dir').'/barfooarticle',
'mime_types' => 'web_images',
));
$this->validatorSchema['centerImage_delete'] = new sfValidatorPass();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment