/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = SpecValue::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
<img class="row-cloner" src="<?php echo Yii::app()->theme->baseUrl; ?> /images/small_icons/clone.png" alt="Clone Row" /> </td> <td class="icons"> <img class="row-remover" src="<?php echo Yii::app()->theme->baseUrl; ?> /images/small_icons/remove.png" alt="Remove Row" /> </td> </tr> <?php } else { $cri = new CDbCriteria(array('condition' => 'spec_id =' . $model->spec_id, 'order' => 'sort_order asc, spec_value_id asc')); $specValues = SpecValue::model()->findAll($cri); foreach ($specValues as $k => $sv) { ?> <tr id="update-template"> <td class="icons"> <img class="drag-handle" src="<?php echo Yii::app()->theme->baseUrl; ?> /images/small_icons/drag.png" alt="click and drag to rearrange" /> </td> <td> <input id="tf1__c" type="text" name="SpecValue[spec_value][]" value="<?php echo $sv->spec_value; ?> " /> </td>