コード例 #1
0
 /**
  * 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 = ModuleType::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
コード例 #2
0
ファイル: _form.php プロジェクト: raedhamam/automation-server
echo $form->labelEx($model, 'channel_count');
?>
		<?php 
echo $form->textField($model, 'channel_count');
?>
		<?php 
echo $form->error($model, 'channel_count');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'module_type_id');
?>
		<?php 
echo $form->dropDownList($model, 'module_type_id', ModuleType::items());
?>
		<?php 
echo $form->error($model, 'module_type_id');
?>
	</div>

	<div class="row buttons">
		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
?>