E
E
Egor Traurov2015-12-05 04:07:53
Yii
Egor Traurov, 2015-12-05 04:07:53

Is there or how to implement radiobutton ID variable for radioButtonList(yii 1)?

Hello.
Due to some nuances in the layout, it became necessary to write the ID of the radio button in the radioButtonList function in labelOptions to the for attribute. It's hard to explain, so here are some examples:

echo $form->radioButtonList($model,'gender', array('f'=>'Женщина','m'=>'Мужчина'),
  array(
     'separator'=>'',
     'template'=>"
          <div class=\"customradio\">
            {input}{beginLabel}{labelTitle}<div></div>{endLabel}
          </div>
     ",
     'labelOptions'=>array('class'=>'inner', 'for'=>$magicVariableExample_gender_0),
     'baseID'=>'gender',
     'uncheckValue'=>null,
  ));

Based on the radio button list view template, you can already understand what I meant. I need to somehow implement a variable that will carry the ID of the corresponding radio button created for it.
Are there any standard tools in Yii? Or at least how to do it yourself? Do I need to extend the class and add the radioButtonList function?
Yii 1.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question