Skip to content

Instantly share code, notes, and snippets.

@slave2zeros
Created February 4, 2013 23:01
Show Gist options
  • Save slave2zeros/4710568 to your computer and use it in GitHub Desktop.
Save slave2zeros/4710568 to your computer and use it in GitHub Desktop.
<?php
namespace Eduguide\CheersBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class CheerGiftFormType extends AbstractType
{
private $giftChoices;
public function __construct(array $giftChoices) {
$this->giftChoices = $giftChoices;
}
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array(
'choices' => $this->giftChoices,
'expanded' => true
));
}
public function getParent()
{
return 'choice';
}
public function getName()
{
return 'cheer_gift';
}
}
@jkm9000
Copy link

jkm9000 commented Feb 4, 2013

setDefaults(array( 'expanded' => true )); } public function getParent() { return 'choice'; } public function getName() { return 'cheer_gift'; } ``` }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment