I have a form type in symfony2.5 that has choice type which has many options set dynamically as
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('service_id', 'choice', array(
'label' => 'Service',
'choices' => $this->getChoice()
));
.......
.......
}
protected function getChoice()
{
$choices = array();
$options = array(
'1' => 'test1',
.............
);
foreach($options as $key => $option)
{
if($key%2 == 0) {
....
} else {
////disabled choice
}
}
}
How can i set this choices set disabled??