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

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

	<div class="row">
		<?php 
echo $form->labelEx($model, 'wttype');
?>
		<?php 
echo $form->textField($model, 'wttype');
?>
		<?php 
echo $form->error($model, 'wttype');
Exemplo n.º 2
0
 public function getZtlist()
 {
     $ztlist = TpZt::model()->findAll();
     return CHtml::listData($ztlist, 'id', 'title');
 }
 /**
  * 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 = TpZt::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }