1
为了避免自定义自动生成的表单,我需要在doctrinechoice小部件上设置“大小”属性。这可能吗?如何从表单/过滤器类设置教义选择部件的大小
为了避免自定义自动生成的表单,我需要在doctrinechoice小部件上设置“大小”属性。这可能吗?如何从表单/过滤器类设置教义选择部件的大小
试试这个在您的表单类:
$this->widgetSchema['your_choice_field'] = new sfWidgetFormDoctrineChoice(
array(), // you have to fill this array with your option (model, multiple, expanded ...)
array('size' => 5) // Attributes array here you can set attribute that will appear on the element
);
希望它可以帮助
干杯该提醒。我结束了使用$ this-> widgetSchema ['field'] - > setAttribute('size',6); – jdog