sfWidgetFormDoctrineChoice只呈现一个值,但查询返回5个值

时间:2013-06-18 21:57:52

标签: symfony1 symfony-1.4

我正在以这种方式在Symfony表单中使用sfWidgetFormDoctrineChoice

$this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor', 'add_empty' => true));

我也尝试过:

$this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor', 'add_empty' => 'Seleccione un Emisor', 'expanded' => false, 'multiple' => false));
$this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor', 'add_empty' => 'Seleccione un Emisor', 'expanded' => false));
$this->widgetSchema['no_emisor'] = new sfWidgetFormDoctrineChoice(array('model' => 'SdrivingEmisor', 'add_empty' => 'Seleccione un Emisor', 'multiple' => false));

但是在HTML级别,当我显示表单时,只呈现一个值:

<select id="sdriving_maquina_no_emisor" name="sdriving_maquina[no_emisor]" label="Emisor">
    <option selected="selected" value=""></option>
    <option value="1">96510020</option>
</select>

虽然生成了查询:

SELECT s.idemisor AS s__idemisor, s.idempresa AS s__idempresa, s.numero AS s__numero, s.created_at AS s__created_at, s.updated_at AS s__updated_at
FROM sdriving_emisor s
phpMyAdmin中的

返回5行,这里有什么问题?

0 个答案:

没有答案