Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Created April 17, 2012 11:51
Show Gist options
  • Save umpirsky/2405545 to your computer and use it in GitHub Desktop.
Save umpirsky/2405545 to your computer and use it in GitHub Desktop.
<?php
namespace Acme\DemoBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilder;
class PictureType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('data', 'hidden')
->add('picture_uploadify', 'uploadify_resource', array(
'data' => array(
'folder' => '/uploads/files/',
'preview' => 'picture_preview',
'path' => 'AcmeDemoBundle_upload',
'copy' => $this->getName() . '_' . 'data'
),
'uploadify' => array(
'auto' => false,
'multi' => true,
// ... other options from http://www.uploadify.com/documentation/
),
'property_path' => false
))
;
}
public function getName()
{
return "picture_type";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment