yii2 的同样的字段循环表单处理
PHP Code复制内容到剪贴板
- foreach ($data as $k => $item){
- if(!$item['children']){
- continue;
- }
- ?>
- <div class="form-group">
- <label class="col-lg-2 col-md-2 control-label" for="product-norms"><?=$item['title']?></label>
- <div class="col-lg-4 col-md-4">
- <?= Html::activeDropDownList($model, "[$k]".FilterBehavior::$formName, ArrayHelper::map($item['children'], 'id', 'title'),['class' => 'form-control','placeholder' => '请输入标题名称','prompt'=>'请选择']) ?>
- </div>
- </div>
- <?
- }
- ?>