开发者

how to set size of doctrine choice widget from form/filter class

开发者 https://www.devze.com 2023-03-30 10:16 出处:网络
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 :

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

精彩评论

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