开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜