1
我有以下形式:传递不同的类名
'region' => new sfWidgetFormChoice(array('expanded' => true,'choices' => $region))
我得到的folloing HTML。
<ul class="radio_list">
<li> first...
<li> second....
我想更改表中类的名称。它不应该是radio_list
。我想用我自己的名字命名? 如何在'地区'做到这一点?
以下是不工作,改变了<li>
类:
'region' => new sfWidgetFormChoice(array('expanded' => true,'choices' => $region), array('class' => 'your_class'))
谢谢!
贡纳尔
这是我的完整的Widget:
$this->setWidgets(array(
'recipename' => new sfWidgetFormInputText(array(), array('size' => '40', 'maxlength' => '150')),
'description' => new sfWidgetFormInputText(array(), array('size' => '40', 'maxlength' => '100')),
'ingredients' => new sfWidgetFormTextarea(array(), array('rows' => '10', 'cols' => '35')),
'preparation' => new sfWidgetFormTextarea(array(), array('rows' => '10', 'cols' => '35')),
'kis' => new sfWidgetFormChoice(array('expanded' => true, 'choices' => $kis)),
'category' => new sfWidgetFormChoice(array('expanded' => true, 'choices' => $category)),
'region' => new sfWidgetFormChoice(array('expanded' => true, 'choices' => $region)),
));
还有一个类似的问题在这里(http://stackoverflow.com/questions/2517328/sfwidgetformchoice-rendered-as-an-unordered-list),可以帮助你。 – 2012-03-01 09:44:42