Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ProdProduitTranslationForm extends BaseProdProduitTranslationForm
- {
- public function configure()
- {
- parent::configure();
- $obj = $this->getObject();
- if (empty($obj['thumb']))
- {
- $this->widgetSchema['thumb'] = new sfWidgetFormInputFileEditable(array(
- 'label' => 'Vignette du produit',
- 'file_src' => '/uploads/produits/' . $obj['thumb'],
- 'is_image' => true,
- 'edit_mode' => !$this->isNew(),
- 'template' => '<div>%file%<br />%input%</div>',
- )
- );
- $this->validatorSchema['thumb'] = new sfValidatorFile(array(
- 'required' => true,
- 'path' => sfConfig::get('sf_upload_dir') . '/produits',
- 'mime_types' => 'web_images'
- ));
- }
- else
- {
- $this->widgetSchema['thumb'] = new sfWidgetFormInputHidden();
- }
- // ....
Add Comment
Please, Sign In to add comment