public function loadModel() { if ($this->_model == null) { if (isset($_GET['id'])) { $condition = ''; $this->_model = group_entity::model()->findByPk($_GET['id'], $condition); } if ($this->_model == null) { throw new CHttpException(404, "The requested page does not exist!"); } } return $this->_model; }
echo $form->dropDownList($model, 'customer_default_group_ID', group_entity::items(), array('class' => 'required-entry required-entry input-select', 'id' => 'def_group', 'name' => 'customer[customer_default_group_ID]')); ?> </td> <td class="scope-label"><span class="nobr"><?php echo $form->error($model, 'customer_default_group_ID'); ?> </span></td> <td><small> </small></td> </tr> <tr> <td class="label"><label for="customer_group">分组挂载<span class="required">*</span></label></td> <td class="value"> <select multiple="multiple" name="customer_group[]" id="product_satus" class="required-entry input-text multiselect"> <?php foreach (group_entity::items() as $key => $row) { $sel = ""; if (isset($groups) && !empty($groups)) { foreach ($groups as $item) { if ($key == $item) { $sel = "selected='true'"; break; } } } echo "<option value='{$key}'{$sel}>{$row}</option>"; } ?> </select> </td> <td class="scope-label"><span class="nobr"></span></td>