Skip to content

Instantly share code, notes, and snippets.

@saksmt
Created August 21, 2014 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saksmt/8f5ca901ac748731ade7 to your computer and use it in GitHub Desktop.
Save saksmt/8f5ca901ac748731ade7 to your computer and use it in GitHub Desktop.
Parent form type
public function buildForm(FormBuilderInterface $builder, array $options)
{
$modelTransformer = new TagsTransformer($this->manager);
$tags = $this->manager->getRepository('ForaSoftImproveClassBundle:Tag')->findAll();
$builder->add(
$builder->create('tags', 'genemu_jqueryselect2_hidden', array(
'configs' => array(
'tags' => $modelTransformer->extractStrings($tags),
'tokenSeparators' => array(' ', ',', ';'),
),
))->addModelTransformer($modelTransformer)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment