我再使用activeform来创建表单,但总有一些不需要代码出现
我如何使用activeform创建表单,只需要在指定的位置创建只有input标签
请老师提供代码,谢谢
<?php $form = ActiveForm::begin()?> <div class="row"> <div class="col-xs-12"> <div class="box"> <div class="box-body table-responsive no-padding"> <table class="table table-hover"> <tr> <th></th> <th>序号</th> <th>名称</th> <th>登记人</th> <th>登记时间</th> <th>状态</th> </tr> <?php $i = 1; foreach ($list as $item ): ?> <tr> <td><?=$form->field($model,'categoryid')->checkbox(['template'=>'<label>{input}</label>','class'=>'aaa'])->label('');?></td> <td><?=$i;?></td> <td><?=$item['title']?></td> <td><?=$item['createuser']?></td> <td><?=date('Y-m-d H:i:s',$item['createtime'])?></td> <td> <?php echo Yii::$app->params['status'][$item['status']];?> </td> </tr> <?php $i++; endforeach; ?> </table> </div> <!-- /.box-body --> </div> <!-- /.box --> </div> </div> </div> <?php ActiveForm::end();?>
但在页面中显示的时候会有
<div class="form-group field-category-categoryid"> <label> <input type="hidden" value="0" name="Category[categoryid]"> <input id="category-categoryid" class="aaa" type="checkbox" value="1" name="Category[categoryid]"> </label> </div>
我只想要
<input type="hidden" value="0" name="Category[categoryid]"> <input id="category-categoryid" class="aaa" type="checkbox" value="1" name="Category[categoryid]">
这样用activeform怎么实现