how to set size of doctrine choice widget from form/filter class
To get around customising autogenerated forms, I need to set the "size" attr开发者_开发百科ibute on a doctrinechoice widget. Is this possible?
try this in your form class :
$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
);
Hope it helps
精彩评论