Created
August 5, 2010 09:06
-
-
Save odracci/509457 to your computer and use it in GitHub Desktop.
sfWidgetFormInputFileEditable
This file contains 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
<?php | |
$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array( | |
'label' => 'Image', | |
'file_src' => sprintf('/uploads/%s/%s', sfConfig::get('app_upload_image_path', 'images') ,$this->getObject()->getImage()), | |
'is_image' => true, | |
'edit_mode' => !$this->isNew(), | |
'template' => '<div>%file%<br />%input%<br />%delete% %delete_label%</div>', | |
)); | |
$this->validatorSchema['image_delete'] = new sfValidatorBoolean(); | |
$this->validatorSchema['image'] = new sfValidatorFile(array( | |
'required' => false, | |
'path' => sprintf('%s/%s', sfConfig::get('sf_upload_dir'), sfConfig::get('app_upload_image_path', 'images')), | |
'mime_types' => 'web_images', | |
)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
'label' => 'Avatar',
'file_src' => sfConfig::get('app_upload_image_path'). $this->getObject()->getImage()),
'is_image' => true,
'edit_mode' => !$this->isNew(),
'template' => '
%input%
%delete% %delete_label%