【发布时间】:2014-01-13 14:51:55
【问题描述】:
我正在使用 YiiBooster 和 Yii 来生成一个表单。
大多数表单都有效 - 预输入、复选框和输入行都可以。当我尝试使用 radioButtonListRow 时,它会呈现模板文本 ({labelTitle}{endLabel}),而不是我的标签文本:
<?php echo $form->radioButtonListRow(
$model,
'radioButtons',
array(
'Option one',
'Option two',
)
); ?>
html 中的结果
<div class="control-group">
<label class="control-label" for="Surveys_radioButtons">GCSE Maths</label>
<div class="controls">
<input id="ytSurveys_radioButtons" type="hidden" value="" name="Surveys[radioButtons]">
<span id="Surveys_radioButtons">
<input id="Surveys_radioButtons_0" value="0" type="radio" name="Surveys[radioButtons]">
{labelTitle}{endLabel}
<input id="Surveys_radioButtons_1" value="1" type="radio" name="Surveys[radioButtons]">
{labelTitle}{endLabel}
</span>
</div>
</div>
上面的例子是直接从YiiBooster examples复制过来的,只是改变了属性名。
有人知道我做错了什么吗?
【问题讨论】:
标签: php twitter-bootstrap yii yii-extensions