<div class="row"> <div class="col-md-3 col-sm-6"> <div class="span2"><?php echo $form->labelEx($model, 'name', array('class' => 'inline-labels')); ?> </div> <div class="span3"><?php echo $form->textField($model, 'name', array('span' => 3, 'maxlength' => 50, 'placeHolder' => 'Supplier Name')); ?> </div> <div class="span2"><?php echo $form->labelEx($model, 'suppliertype_id', array('class' => 'inline-labels')); ?> </div> <div class="span3"><?php echo $form->dropDownList($model, 'suppliertype_id', CHtml::listData(Suppliertype::model()->findAll(), 'id', 'name'), array('span' => 2, 'prompt' => '-------')); ?> <?php echo CHtml::ajaxLink(Yii::t('suppliertype', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('suppliertype/addnew'), array('onclick' => '$("#divDialog7").dialog("open"); return false;', 'update' => '#divDialog7'), array('id' => uniqid())); ?> <div id="divDialog7"></div> </div> </div> </tr> <tr> <div class="row"> <div class="col-md-3 col-sm-6"> <div class="span2"><?php echo $form->labelEx($model, 'add1', array('class' => 'inline-labels')); ?> </div>
/** * 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 $id the ID of the model to be loaded * @return Suppliertype the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Suppliertype::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }