2015-12-22 43 views
0

通常情况下,这个代码<?= $form->field($model, 'q_36a')->checkbox() ?>将产生如下...如何修改活动表格场yii2

<div class="form-group field-tblquestion-q_36a required"> 

<input type="hidden" name="TblQuestion[q_36a]" value="0"><label><input type="checkbox" id="tblquestion-q_36a" name="TblQuestion[q_36a]" value="1"> Q 36a</label> 

<div class="help-block"></div> 
</div> 

如何修改它,使其这个样子?

<label> 
     <input name="switch-field-1" class="ace ace-switch ace-switch-5" type="checkbox"> 
     <span class="lbl"></span> 
</label> 

我想这样做,因为我在我的应用程序中集成了ace管理模板。

回答

-1

得到它的工作。

<?= $form->field($model, 'q_36a', ['template' => "{input}<span class='lbl'></span>",])->checkbox(['class' => 'ace ace-switch ace-switch-5'], false) ?>