Esempio n. 1
0
echo $form->labelEx($model, 'title');
?>
		<?php 
echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 255));
?>
		<?php 
echo $form->error($model, 'title');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'expensestypeid');
?>
		<?php 
echo $form->dropDownList($model, 'expensestypeid', CHtml::listData(ExpensesTypes::model()->findAll(), 'id', 'title'), array('prompt' => 'Choose'));
?>
		<?php 
//echo $form->textField($model,'expensestypeid');
?>
		<?php 
echo $form->error($model, 'expensestypeid');
?>

	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'datetime');
?>
		<?php 
 /**
  * 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 ExpensesTypes the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = ExpensesTypes::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }