2012-02-29 10 views
1

は、私は次の形式を持っています。パス別のクラス名

<ul class="radio_list"> 
    <li> first... 
    <li> second.... 

テーブルのクラス名を変更したいと思います。 radio_listであってはなりません。私は自分の名前を付けたいのですか? 「地域」でどうすればいいですか?

後の作業と<li>のクラスを変更していません。

'region' => new sfWidgetFormChoice(array('expanded' => true,'choices' => $region), array('class' => 'your_class')) 

感謝を!

グンナー

これは私の完全なウィジェットです:

 $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)), 
    )); 
+0

似たような質問があります(http://stackoverflow.com/questions/2517328/sfwidgetformchoice-rendered-as-an-unordered-list)。 –

答えて

2

あなたはsfWidgetFormSelectRadioオーバーライドはそれ自身のオプションを持つ属性を通過したことから、そのためにrenderer_optionsを使用する必要があります。

new sfWidgetFormChoice(array(
    'expanded' => true, 
    'choices' => $region, 
    'renderer_options' => array(
     'class' => 'your_class' 
    ) 
); 
+0

はい!ありがとう。私はsymfonyの構文を取得しませんでした。なぜなら、私はこれを何らかの形でこの方法で試しました。しかし、あなたの方法は働いている!ありがとう! (ダンケ!) – craphunter

関連する問題