コード例 #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 = Scolor::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
コード例 #2
0
ファイル: _form.php プロジェクト: bbustillos/saleh_dev
echo $form->textFieldRow($model, 'marca', array('style' => 'width:100px'));
?>

	<?php 
echo $form->textFieldRow($model, 'modelo', array('style' => 'width:60px'));
?>

	<?php 
echo $form->textFieldRow($model, 'numero_chasis', array('style' => 'width:200px'));
?>
	
	<?php 
echo $form->textFieldRow($model, 'numero_motor', array('style' => 'width:200px'));
?>

	<b><?php 
echo $form->labelEx($model, 'color_id');
?>
</b>
	<?php 
echo $form->dropDownList($model, 'color_id', CHtml::listData(Scolor::model()->findAll(), 'color_id', 'color_descripcion'), array('empty' => '-- Seleccionar --'));
?>

	<div class="form-actions">
		<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Almacenar' : 'Actualizar'));
?>
	</div>

<?php 
$this->endWidget();