if ($model->hasErrors()) { ?> <div class="control-group"> <?php echo $form->errorSummary($model); ?> </div> <?php } ?> <div class="control-group"><p class="help-block">带 <span class="required">*</span> 的字段为必填项.</p></div> <?php $item = new Item(); echo $form->dropDownListGroup($model, 'category_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => $item->attrCategory(3), 'htmlOptions' => array('class' => 'col-sm-5')))); echo $form->dropDownListGroup($model, 'parent_prop_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => $props, 'htmlOptions' => array('class' => 'col-sm-5')))); echo $form->textFieldGroup($model, 'prop_name'); echo $form->textFieldGroup($model, 'prop_alias'); echo $form->radioButtonListGroup($model, 'type', array('widgetOptions' => array('data' => $model->attrType()))); foreach (array('is_key_prop' => 'allKey', 'is_sale_prop' => 'allSale', 'is_color_prop' => 'allColor', 'must' => 'allMust', 'multi' => 'allMulti', 'status' => 'allStatus') as $k => $v) { // echo $form->dropDownListGroup($model, $k, call_user_func(array($model, $v))); echo $form->dropDownListGroup($model, $k, array('wrapperHtmlOptions' => array('class' => 'col-sm-5'), 'widgetOptions' => array('data' => call_user_func(array($model, $v)), 'htmlOptions' => array('class' => 'col-sm-5')))); } ?> <h2><a id="add-row" href="#">添加属性值</a></h2> <legend>属性值</legend> <div class="PropValues"> <table id="add_prop" class="example">