Created
August 19, 2010 12:22
-
-
Save caefer/537740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BarfooArticleForm extends BaseBarfooArticleForm | |
{ | |
public function configure() | |
{ | |
$file_src = sfContext::getInstance()->getController()->genUrl(array( | |
'sf_route' => 'sf_image', | |
'format' => 'backend_edit', | |
'type' => 'BarfooArticle', | |
'attribute' => 'topImage', | |
'slug' => $this->getObject()->slug, | |
'id' => $this->getObject()->id | |
), false); | |
$this->widgetSchema['topImage'] = new sfWidgetFormInputFileEditable(array( | |
'label' => 'Image', | |
'is_image' => true, | |
'file_src' => $file_src | |
)); | |
$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(); | |
$file_src = sfContext::getInstance()->getController()->genUrl(array( | |
'sf_route' => 'sf_image', | |
'format' => 'backend_edit', | |
'type' => 'BarfooArticle', | |
'attribute' => 'centerImage', | |
'slug' => $this->getObject()->slug, | |
'id' => $this->getObject()->id | |
), false); | |
$this->widgetSchema['centerImage'] = new sfWidgetFormInputFileEditable(array( | |
'label' => 'Image', | |
'is_image' => true, | |
'file_src' => $file_src | |
)); | |
$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