Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. <?php
  2.  
  3. class ProdProduitTranslationForm extends BaseProdProduitTranslationForm
  4. {
  5. public function configure()
  6. {
  7. parent::configure();
  8. $obj = $this->getObject();
  9. if (empty($obj['thumb']))
  10. {
  11. $this->widgetSchema['thumb'] = new sfWidgetFormInputFileEditable(array(
  12. 'label' => 'Vignette du produit',
  13. 'file_src' => '/uploads/produits/' . $obj['thumb'],
  14. 'is_image' => true,
  15. 'edit_mode' => !$this->isNew(),
  16. 'template' => '<div>%file%<br />%input%</div>',
  17. )
  18. );
  19.  
  20. $this->validatorSchema['thumb'] = new sfValidatorFile(array(
  21. 'required' => true,
  22. 'path' => sfConfig::get('sf_upload_dir') . '/produits',
  23. 'mime_types' => 'web_images'
  24. ));
  25. }
  26. else
  27. {
  28. $this->widgetSchema['thumb'] = new sfWidgetFormInputHidden();
  29. }
  30.  
  31. // ....
Add Comment
Please, Sign In to add comment