0
我使用的是Symfony版本2.5.4,我有一個看起來像這樣的構建器。Symfony2中的外部選項字段
$builder->add('Licensed', 'choice', array(
'choices' => array(
'N/A' => '--',
'Yes' => 'Yes',
'No' => 'No'
),
'required' => false,
'label' => 'Somelabel',
'label_attr' => array('class' => 'font-bold'),
'attr' => array('class' => 'rounded')
)
);
當我呈現的形式獲得:
<select id="companyotherinformation_Licensed" name="companyotherinformation[Licensed]" class="rounded">
<option value=""></option> <-- Not sure where this is coming from.
<option value="N/A">--</option>
<option value="Yes">Yes</option>
<option value="No">No</option>
</select>
有一個<option value=""></option>
,但我不知道它是如何到達那裏。我可以在哪裏查找它的來源並擺脫它?它可能是一個Symfony2錯誤?我也嘗試過app/console cache:clear
,我仍然無法擺脫它。
太好了,謝謝你的提供。 – Tek 2014-09-22 14:36:29