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