예제 #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 $id the ID of the model to be loaded
  * @return Benchmarks the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Benchmarks::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
예제 #2
0
파일: _form.php 프로젝트: artmart/verare
$form = $this->beginWidget('CActiveForm', array('id' => 'benchmark-components-form', 'enableAjaxValidation' => false));
?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php 
echo $form->errorSummary($model);
?>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'benchmark_id');
?>
		<?php 
//echo $form->textField($model,'benchmark_id');
echo $form->dropDownList($model, 'benchmark_id', CHtml::listData(Benchmarks::model()->findAll(array('select' => 'id, benchmark_name', 'order' => 'benchmark_name')), 'id', 'benchmark_name'), array('empty' => '- Select -'));
?>
		<?php 
echo $form->error($model, 'benchmark_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'instrument_id');
?>
		<?php 
//echo $form->textField($model,'instrument_id');
echo $form->dropDownList($model, 'instrument_id', CHtml::listData(instruments::model()->findAll(array('select' => 'id, instrument', 'order' => 'instrument')), 'id', 'instrument'), array('empty' => '- Select -'));
?>
		<?php