Skip to content

Instantly share code, notes, and snippets.

@mogi
Created October 8, 2010 08:39
Show Gist options
  • Save mogi/616522 to your computer and use it in GitHub Desktop.
Save mogi/616522 to your computer and use it in GitHub Desktop.
public function setPhoto()
{
$options = array(
'file_src' => '',
'is_image' => true,
'with_delete' => false,
'template' => get_partial('default/formEditImage', array('image' => $this->getObject())),
);
$this->setWidget('photo', new sfWidgetFormInputFileEditable($options, array('size' => 40)));
$this->setValidator('photo', new opValidatorImageFile(array('required' => false)));
}
public function setAlbumChoices()
{
$choices = Doctrine::getTable('Album')->getMemberAlbumTitleArray($this->getObject()->getMemberId());
$this->setWidget('album_id', new sfWidgetFormChoice(array('choices' => $choices, 'expanded' => false, 'multiple' => false)));
$this->setValidator('album_id', new sfValidatorChoice(array('choices' => array_keys($choices))));
}
http://github.com/mogi/opAlbumPlugin/commit/d70e96524dcb6bee4e200b786f9098380e417a04#diff-7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment