Skip to content

Instantly share code, notes, and snippets.

@florinutz
Created March 25, 2014 15:48
Show Gist options
  • Save florinutz/9764709 to your computer and use it in GitHub Desktop.
Save florinutz/9764709 to your computer and use it in GitHub Desktop.
<?php
// florin 3/25/14 2:16 PM
namespace Wyzbiz\Bundle\MainBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class ModelListExtension extends AbstractTypeExtension
{
public function getExtendedType()
{
return 'sonata_type_model_list';
}
/**
* Add the multiple option
*
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setOptional(array('multiple'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment